diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Argument.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Argument.java index 6979a22888..07971808b6 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Argument.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Argument.java @@ -13,7 +13,6 @@ import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; import java.util.LinkedHashSet; import java.util.Set; @@ -33,7 +32,6 @@ @Data @EqualsAndHashCode() @AllArgsConstructor -@NoArgsConstructor @Builder public class Argument implements Named { @@ -48,7 +46,7 @@ public class Argument implements Named { @JsonProperty("values") @JsonDeserialize(as = LinkedHashSet.class) - private Set values = new LinkedHashSet<>(); + private Set values; @JsonProperty("tableSource") private String tableSource; @@ -56,6 +54,10 @@ public class Argument implements Named { @JsonProperty("default") private Object defaultValue; + public Argument() { + this.values = new LinkedHashSet<>(); + } + /** * Returns description of the argument. * If null, returns the name diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java index cd0cb91f3a..cbe58c8998 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Dimension.java @@ -13,7 +13,6 @@ import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; import lombok.Singular; import java.util.ArrayList; @@ -45,7 +44,6 @@ @Data @EqualsAndHashCode() @AllArgsConstructor -@NoArgsConstructor @Builder public class Dimension implements Named { @@ -62,10 +60,10 @@ public class Dimension implements Named { private String category; @JsonProperty("hidden") - private Boolean hidden = false; + private Boolean hidden; @JsonProperty("readAccess") - private String readAccess = "Prefab.Role.All"; + private String readAccess; @JsonProperty("definition") private String definition; @@ -78,23 +76,32 @@ public class Dimension implements Named { @JsonProperty("grains") @Singular - private List grains = new ArrayList<>(); + private List grains; @JsonProperty("tags") @JsonDeserialize(as = LinkedHashSet.class) - private Set tags = new LinkedHashSet<>(); + private Set tags; @JsonProperty("arguments") @Singular - private List arguments = new ArrayList<>(); + private List arguments; @JsonProperty("values") @JsonDeserialize(as = LinkedHashSet.class) - private Set values = new LinkedHashSet<>(); + private Set values; @JsonProperty("tableSource") private String tableSource; + public Dimension() { + this.hidden = false; + this.readAccess = "Prefab.Role.All"; + this.grains = new ArrayList<>(); + this.tags = new LinkedHashSet<>(); + this.values = new LinkedHashSet<>(); + this.arguments = new ArrayList<>(); + } + /** * Returns description of the dimension. * If null, returns the name. diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Join.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Join.java index 61851b3e50..e4ffc57f72 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Join.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Join.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; /** * Joins describe the SQL expression necessary to join two physical tables. @@ -29,7 +29,6 @@ @Data @EqualsAndHashCode() @AllArgsConstructor -@NoArgsConstructor @Builder public class Join implements Named { @@ -43,11 +42,15 @@ public class Join implements Named { private Join.Type type; @JsonProperty("kind") - private Join.Kind kind = Join.Kind.TOONE; + private Join.Kind kind; @JsonProperty("definition") private String definition; + public Join() { + this.kind = Join.Kind.TOONE; + } + public enum Kind { TOONE("toOne"), diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java index df3ea865fc..61f4937ba5 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Measure.java @@ -13,7 +13,6 @@ import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; import lombok.Singular; import java.util.ArrayList; @@ -41,7 +40,6 @@ @Data @EqualsAndHashCode() @AllArgsConstructor -@NoArgsConstructor @Builder public class Measure implements Named { @@ -58,10 +56,10 @@ public class Measure implements Named { private String category; @JsonProperty("hidden") - private Boolean hidden = false; + private Boolean hidden; @JsonProperty("readAccess") - private String readAccess = "Prefab.Role.All"; + private String readAccess; @JsonProperty("definition") private String definition; @@ -74,11 +72,18 @@ public class Measure implements Named { @JsonProperty("tags") @JsonDeserialize(as = LinkedHashSet.class) - private Set tags = new LinkedHashSet<>(); + private Set tags; @JsonProperty("arguments") @Singular - private List arguments = new ArrayList<>(); + private List arguments; + + public Measure() { + this.hidden = false; + this.readAccess = "Prefab.Role.All"; + this.tags = new LinkedHashSet<>(); + this.arguments = new ArrayList<>(); + } /** * Returns description of the measure. diff --git a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java index dd18724980..00692d725c 100644 --- a/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java +++ b/elide-model-config/src/main/java/com/yahoo/elide/modelconfig/model/Table.java @@ -16,7 +16,6 @@ import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; import lombok.Singular; import java.util.ArrayList; @@ -51,7 +50,6 @@ @Data @EqualsAndHashCode() @AllArgsConstructor -@NoArgsConstructor @Builder public class Table implements Named { @@ -68,10 +66,10 @@ public class Table implements Named { private String dbConnectionName; @JsonProperty("isFact") - private Boolean isFact = true; + private Boolean isFact; @JsonProperty("hidden") - private Boolean hidden = false; + private Boolean hidden; @JsonProperty("description") private String description; @@ -86,27 +84,27 @@ public class Table implements Named { private String cardinality; @JsonProperty("readAccess") - private String readAccess = "Prefab.Role.All"; + private String readAccess; @JsonProperty("joins") @Singular - private List joins = new ArrayList<>(); + private List joins; @JsonProperty("measures") @Singular - private List measures = new ArrayList<>(); + private List measures; @JsonProperty("dimensions") @Singular - private List dimensions = new ArrayList<>(); + private List dimensions; @JsonProperty("tags") @JsonDeserialize(as = LinkedHashSet.class) - private Set tags = new LinkedHashSet<>(); + private Set tags; @JsonProperty("arguments") @Singular - private List arguments = new ArrayList<>(); + private List arguments; @JsonProperty("extend") private String extend; @@ -117,6 +115,17 @@ public class Table implements Named { @JsonProperty("table") private String table; + public Table() { + this.isFact = true; + this.hidden = false; + this.readAccess = "Prefab.Role.All"; + this.joins = new ArrayList<>(); + this.measures = new ArrayList<>(); + this.dimensions = new ArrayList<>(); + this.tags = new LinkedHashSet<>(); + this.arguments = new ArrayList<>(); + } + /** * Returns description of the table object. * If null, returns the name.