Created
December 17, 2017 15:03
-
-
Save Jayasagar/391d9348770c8af7eda25339fe17061e to your computer and use it in GitHub Desktop.
Data model used for the examples below
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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