Skip to content

Instantly share code, notes, and snippets.

@Jayasagar
Created December 17, 2017 15:03
Show Gist options
  • Save Jayasagar/391d9348770c8af7eda25339fe17061e to your computer and use it in GitHub Desktop.
Save Jayasagar/391d9348770c8af7eda25339fe17061e to your computer and use it in GitHub Desktop.
Data model used for the examples below
@Getter @Setter @Builder @ToString(of = {"name", "city"})
public class Consumer {
private String name;
private String city;
private int age;
private List<Thing> things;
}
@Setter @Getter @Builder @ToString(of = {"name"})
public class Thing {// Device in IoT
private String id;
private String name;
private boolean isRunning;
private Type type;
private List<Event> events;
private int cost;
}
@Getter @Setter @Builder @ToString(of = {"name"})
public class Event {
private String name;
private boolean isActive;
}
public enum Type {
HOME, FIELD, COMMUNICATION, HEALTH
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment