From d38f6c1cc56eba5ee4c0be5242c7218a86f5c83b Mon Sep 17 00:00:00 2001 From: kpoulakakis Date: Fri, 5 Apr 2024 15:19:57 +0300 Subject: [PATCH 1/2] Create TMF 673 model entities. --- .../tmf/gam673/model/GeographicAddress.java | 146 +++++++++++++++ .../model/GeographicAddressValidation.java | 129 +++++++++++++ .../model/GeographicLocationRefOrValue.java | 82 +++++++++ .../gam673/model/GeographicSubAddress.java | 172 ++++++++++++++++++ .../osl/tmf/gam673/model/TaskStateType.java | 24 +++ 5 files changed, 553 insertions(+) create mode 100644 src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java create mode 100644 src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java create mode 100644 src/main/java/org/etsi/osl/tmf/gam673/model/GeographicLocationRefOrValue.java create mode 100644 src/main/java/org/etsi/osl/tmf/gam673/model/GeographicSubAddress.java create mode 100644 src/main/java/org/etsi/osl/tmf/gam673/model/TaskStateType.java diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java new file mode 100644 index 0000000..a2065ed --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java @@ -0,0 +1,146 @@ +package org.etsi.osl.tmf.gam673.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.validation.Valid; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; +import org.springframework.validation.annotation.Validated; + +import java.util.List; +import java.util.Objects; + +@Schema(description = "Structured textual way of describing how to find a Property in an urban area (country properties are often defined\n" + + "differently).\n" + + "Note : Address corresponds to SID UrbanPropertyAddress.") +@Validated +@Entity +public class GeographicAddress extends BaseRootNamedEntity { + + @JsonProperty("id") + private String id = null; + + @JsonProperty("city") + private String city; + + @JsonProperty("country") + private String country; + + @JsonProperty("geographicLocation") + @Valid + @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private GeographicLocationRefOrValue geographicLocation; + + @JsonProperty("geographicSubAddress") + @Valid + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private List geographicSubAddress; + + @JsonProperty("locality") + private String locality; + + @JsonProperty("postcode") + private String postcode; + + @JsonProperty("stateOrProvince") + private String stateOrProvince; + + @JsonProperty("streetName") + private String streetName; + + @JsonProperty("streetNr") + private String streetNr; + + @JsonProperty("streetNrLast") + private String streetNrLast; + + @JsonProperty("streetNrLastSuffix") + private String streetNrLastSuffix; + + @JsonProperty("streetNrSuffix") + private String streetNrSuffix; + + @JsonProperty("streetSuffix") + private String streetSuffix; + + @JsonProperty("streetType") + private String streetType; + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeographicAddress geographicAddress = (GeographicAddress) o; + return Objects.equals(this.id, geographicAddress.id) + && Objects.equals(this.name, geographicAddress.name) + && Objects.equals(this.city, geographicAddress.city) + && Objects.equals(this.country, geographicAddress.country) + && Objects.equals(this.geographicLocation, geographicAddress.geographicLocation) + && Objects.equals(this.geographicSubAddress, geographicAddress.geographicSubAddress) + && Objects.equals(this.locality, geographicAddress.locality) + && Objects.equals(this.postcode, geographicAddress.postcode) + && Objects.equals(this.stateOrProvince, geographicAddress.stateOrProvince) + && Objects.equals(this.streetName, geographicAddress.streetName) + && Objects.equals(this.streetNr, geographicAddress.streetNr) + && Objects.equals(this.streetNrLast, geographicAddress.streetNrLast) + && Objects.equals(this.streetNrLastSuffix, geographicAddress.streetNrLastSuffix) + && Objects.equals(this.streetNrSuffix, geographicAddress.streetNrSuffix) + && Objects.equals(this.streetSuffix, geographicAddress.streetSuffix) + && Objects.equals(this.streetType, geographicAddress.streetType) + && Objects.equals(this.baseType, geographicAddress.baseType) + && Objects.equals(this.schemaLocation, geographicAddress.schemaLocation) + && Objects.equals(this.type, geographicAddress.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, city, country, geographicLocation, geographicSubAddress, locality, postcode, stateOrProvince, streetName, streetNr, streetNrLast, streetNrLastSuffix, streetNrSuffix, streetSuffix, streetType, baseType, schemaLocation, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class geographicAddress {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" geographicLocation: ").append(toIndentedString(geographicLocation)).append("\n"); + sb.append(" geographicSubAddress: ").append(toIndentedString(geographicSubAddress)).append("\n"); + sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); + sb.append(" postcode: ").append(toIndentedString(postcode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); + sb.append(" streetName: ").append(toIndentedString(streetName)).append("\n"); + sb.append(" streetNr: ").append(toIndentedString(streetNr)).append("\n"); + sb.append(" streetNrLast: ").append(toIndentedString(streetNrLast)).append("\n"); + sb.append(" streetNrLastSuffix: ").append(toIndentedString(streetNrLastSuffix)).append("\n"); + sb.append(" streetNrSuffix: ").append(toIndentedString(streetNrSuffix)).append("\n"); + sb.append(" streetSuffix: ").append(toIndentedString(streetSuffix)).append("\n"); + sb.append(" streetType: ").append(toIndentedString(streetType)).append("\n"); + sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java new file mode 100644 index 0000000..78c04d1 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java @@ -0,0 +1,129 @@ +package org.etsi.osl.tmf.gam673.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.validation.Valid; +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.springframework.validation.annotation.Validated; + +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Objects; + +@Schema(description = "GeographicAddressValidation is a base class for defining the validation of a GeographicAddress.") +@Validated +@Entity +public class GeographicAddressValidation extends BaseRootEntity { + + @JsonProperty("alternateGeographicAddress") + @Valid + @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private List alternateGeographicAddress; + + @JsonProperty("provideAlternative") + private Boolean provideAlternative; + @JsonProperty("status") + private String status; + + @JsonProperty("validAddress") + @Valid + @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + private GeographicAddress validAddress; + + @JsonProperty("validationDate") + private OffsetDateTime validationDate; + @JsonProperty("validationResult") + private String validationResult; + + public Boolean getProvideAlternative() { + return provideAlternative; + } + + public void setProvideAlternative(Boolean provideAlternative) { + this.provideAlternative = provideAlternative; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public OffsetDateTime getValidationDate() { + return validationDate; + } + + public void setValidationDate(OffsetDateTime validationDate) { + this.validationDate = validationDate; + } + + public String getValidationResult() { + return validationResult; + } + + public void setValidationResult(String validationResult) { + this.validationResult = validationResult; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeographicAddressValidation geographicAddressValidation = (GeographicAddressValidation) o; + return Objects.equals(this.alternateGeographicAddress, geographicAddressValidation.alternateGeographicAddress) + && Objects.equals(this.provideAlternative, geographicAddressValidation.provideAlternative) + && Objects.equals(this.status, geographicAddressValidation.status) + && Objects.equals(this.validAddress, geographicAddressValidation.validAddress) + && Objects.equals(this.validationDate, geographicAddressValidation.validationDate) + && Objects.equals(this.validationResult, geographicAddressValidation.validationResult) + && Objects.equals(this.baseType, geographicAddressValidation.baseType) + && Objects.equals(this.schemaLocation, geographicAddressValidation.schemaLocation) + && Objects.equals(this.type, geographicAddressValidation.type); + } + + @Override + public int hashCode() { + return Objects.hash(alternateGeographicAddress, provideAlternative, status, validAddress, validationDate, validationResult, baseType, schemaLocation, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class geographicAddressValidation {\n"); + + sb.append(" alternateGeographicAddress: ").append(toIndentedString(alternateGeographicAddress)).append("\n"); + sb.append(" provideAlternative: ").append(toIndentedString(provideAlternative)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" validAddress: ").append(toIndentedString(validAddress)).append("\n"); + sb.append(" validationDate: ").append(toIndentedString(validationDate)).append("\n"); + sb.append(" validationResult: ").append(toIndentedString(validationResult)).append("\n"); + sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicLocationRefOrValue.java b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicLocationRefOrValue.java new file mode 100644 index 0000000..e914883 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicLocationRefOrValue.java @@ -0,0 +1,82 @@ +package org.etsi.osl.tmf.gam673.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.persistence.Entity; +import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.springframework.validation.annotation.Validated; + +import java.util.Objects; + +@Validated +@Entity +public class GeographicLocationRefOrValue extends BaseRootEntity { + + @JsonProperty("role") + private String role; + @JsonProperty("referredType") + private String referredType; + + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getReferredType() { + return referredType; + } + + public void setReferredType(String referredType) { + this.referredType = referredType; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeographicLocationRefOrValue geographicLocationRefOrValue = (GeographicLocationRefOrValue) o; + return Objects.equals(this.role, geographicLocationRefOrValue.role) + && Objects.equals(this.referredType, geographicLocationRefOrValue.referredType) + && Objects.equals(this.baseType, geographicLocationRefOrValue.baseType) + && Objects.equals(this.schemaLocation, geographicLocationRefOrValue.schemaLocation) + && Objects.equals(this.type, geographicLocationRefOrValue.type); + } + + @Override + public int hashCode() { + return Objects.hash(role, referredType, baseType, schemaLocation, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class geographicLocationRefOrValue {\n"); + + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" referredType: ").append(toIndentedString(referredType)).append("\n"); + sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicSubAddress.java b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicSubAddress.java new file mode 100644 index 0000000..75b8b25 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicSubAddress.java @@ -0,0 +1,172 @@ +package org.etsi.osl.tmf.gam673.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Entity; +import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; +import org.springframework.validation.annotation.Validated; + +import java.util.Objects; + +@Schema(description = "Representation of a GeographicSubAddress\n" + + "It is used for addressing within a property in an urban area (country properties are often defined differently). It may\n" + + "refer to a building, a building cluster, or a floor of a multistory building.") +@Validated +@Entity +public class GeographicSubAddress extends BaseRootNamedEntity { + + @JsonProperty("id") + private String id = null; + + @JsonProperty("buildingName") + private String buildingName; + + @JsonProperty("levelNumber") + private String levelNumber; + + @JsonProperty("levelType") + private String levelType; + + @JsonProperty("privateStreetName") + private String privateStreetName; + + @JsonProperty("privateStreetNumber") + private String privateStreetNumber; + + @JsonProperty("subAddressType") + private String subAddressType; + + @JsonProperty("subUnitNumber") + private String subUnitNumber; + + @JsonProperty("subUnitType") + private String subUnitType; + + public String getBuildingName() { + return buildingName; + } + + public void setBuildingName(String buildingName) { + this.buildingName = buildingName; + } + + public String getLevelNumber() { + return levelNumber; + } + + public void setLevelNumber(String levelNumber) { + this.levelNumber = levelNumber; + } + + public String getLevelType() { + return levelType; + } + + public void setLevelType(String levelType) { + this.levelType = levelType; + } + + public String getPrivateStreetName() { + return privateStreetName; + } + + public void setPrivateStreetName(String privateStreetName) { + this.privateStreetName = privateStreetName; + } + + public String getPrivateStreetNumber() { + return privateStreetNumber; + } + + public void setPrivateStreetNumber(String privateStreetNumber) { + this.privateStreetNumber = privateStreetNumber; + } + + public String getSubAddressType() { + return subAddressType; + } + + public void setSubAddressType(String subAddressType) { + this.subAddressType = subAddressType; + } + + public String getSubUnitNumber() { + return subUnitNumber; + } + + public void setSubUnitNumber(String subUnitNumber) { + this.subUnitNumber = subUnitNumber; + } + + public String getSubUnitType() { + return subUnitType; + } + + public void setSubUnitType(String subUnitType) { + this.subUnitType = subUnitType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeographicSubAddress geographicSubAddress = (GeographicSubAddress) o; + return Objects.equals(this.id, geographicSubAddress.id) + && Objects.equals(this.name, geographicSubAddress.name) + && Objects.equals(this.buildingName, geographicSubAddress.buildingName) + && Objects.equals(this.levelNumber, geographicSubAddress.levelNumber) + && Objects.equals(this.levelType, geographicSubAddress.levelType) + && Objects.equals(this.privateStreetName, geographicSubAddress.privateStreetName) + && Objects.equals(this.privateStreetNumber, geographicSubAddress.privateStreetNumber) + && Objects.equals(this.subAddressType, geographicSubAddress.subAddressType) + && Objects.equals(this.subUnitNumber, geographicSubAddress.subUnitNumber) + && Objects.equals(this.subUnitType, geographicSubAddress.subUnitType) + && Objects.equals(this.baseType, geographicSubAddress.baseType) + && Objects.equals(this.schemaLocation, geographicSubAddress.schemaLocation) + && Objects.equals(this.type, geographicSubAddress.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, buildingName, levelNumber, levelType, privateStreetName, privateStreetNumber, subAddressType, subUnitNumber, subUnitType, baseType, schemaLocation, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeographicSubAddress {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" buildingName: ").append(toIndentedString(buildingName)).append("\n"); + sb.append(" levelNumber: ").append(toIndentedString(levelNumber)).append("\n"); + sb.append(" levelType: ").append(toIndentedString(levelType)).append("\n"); + sb.append(" privateStreetName: ").append(toIndentedString(privateStreetName)).append("\n"); + sb.append(" privateStreetNumber: ").append(toIndentedString(privateStreetNumber)).append("\n"); + sb.append(" subAddressType: ").append(toIndentedString(subAddressType)).append("\n"); + sb.append(" subUnitNumber: ").append(toIndentedString(subUnitNumber)).append("\n"); + sb.append(" subUnitType: ").append(toIndentedString(subUnitType)).append("\n"); + sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); + sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/TaskStateType.java b/src/main/java/org/etsi/osl/tmf/gam673/model/TaskStateType.java new file mode 100644 index 0000000..e8cd073 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/TaskStateType.java @@ -0,0 +1,24 @@ +package org.etsi.osl.tmf.gam673.model; + +public enum TaskStateType { + + ACKNOWLEDGED("acknowledged"), + TERMINATED_WITH_ERROR("terminatedWithError"), + IN_PROGRESS("inProgress"), + DONE("done"); + + private String action; + + private TaskStateType(String action) { + this.action = action; + } + + public String getAction() { + return this.action; + } + + private void setAction(String action) { + this.action = action; + } + +} -- GitLab From 03851066e5abbe7565de6665800c43e6fe52fc45 Mon Sep 17 00:00:00 2001 From: kpoulakakis Date: Thu, 11 Apr 2024 15:59:34 +0300 Subject: [PATCH 2/2] Add TMF 673 model setter and getter methods. --- .../tmf/gam673/model/GeographicAddress.java | 146 +++++++++++++++++- .../model/GeographicAddressValidation.java | 41 ++++- 2 files changed, 177 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java index a2065ed..bb97e9c 100644 --- a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddress.java @@ -10,8 +10,9 @@ import jakarta.validation.Valid; import org.etsi.osl.tmf.common.model.BaseRootNamedEntity; import org.springframework.validation.annotation.Validated; -import java.util.List; +import java.util.HashSet; import java.util.Objects; +import java.util.Set; @Schema(description = "Structured textual way of describing how to find a Property in an urban area (country properties are often defined\n" + "differently).\n" + @@ -37,7 +38,7 @@ public class GeographicAddress extends BaseRootNamedEntity { @JsonProperty("geographicSubAddress") @Valid @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) - private List geographicSubAddress; + private Set geographicSubAddresses; @JsonProperty("locality") private String locality; @@ -69,6 +70,141 @@ public class GeographicAddress extends BaseRootNamedEntity { @JsonProperty("streetType") private String streetType; + public GeographicAddress geographicSubAddresses(Set geographicSubAddresses) { + this.geographicSubAddresses = geographicSubAddresses; + return this; + } + + public GeographicAddress addGeographicSubAddress(GeographicSubAddress geographicSubAddress) { + if (this.geographicSubAddresses == null) { + this.geographicSubAddresses = new HashSet<>(); + } + this.geographicSubAddresses.add(geographicSubAddress); + return this; + } + + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public GeographicLocationRefOrValue getGeographicLocation() { + return geographicLocation; + } + + public void setGeographicLocation(GeographicLocationRefOrValue geographicLocation) { + this.geographicLocation = geographicLocation; + } + + public Set getGeographicSubAddresses() { + return geographicSubAddresses; + } + + public void setGeographicSubAddresses(Set geographicSubAddresses) { + this.geographicSubAddresses = geographicSubAddresses; + } + + public String getLocality() { + return locality; + } + + public void setLocality(String locality) { + this.locality = locality; + } + + public String getPostcode() { + return postcode; + } + + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + public String getStateOrProvince() { + return stateOrProvince; + } + + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + public String getStreetName() { + return streetName; + } + + public void setStreetName(String streetName) { + this.streetName = streetName; + } + + public String getStreetNr() { + return streetNr; + } + + public void setStreetNr(String streetNr) { + this.streetNr = streetNr; + } + + public String getStreetNrLast() { + return streetNrLast; + } + + public void setStreetNrLast(String streetNrLast) { + this.streetNrLast = streetNrLast; + } + + public String getStreetNrLastSuffix() { + return streetNrLastSuffix; + } + + public void setStreetNrLastSuffix(String streetNrLastSuffix) { + this.streetNrLastSuffix = streetNrLastSuffix; + } + + public String getStreetNrSuffix() { + return streetNrSuffix; + } + + public void setStreetNrSuffix(String streetNrSuffix) { + this.streetNrSuffix = streetNrSuffix; + } + + public String getStreetSuffix() { + return streetSuffix; + } + + public void setStreetSuffix(String streetSuffix) { + this.streetSuffix = streetSuffix; + } + + public String getStreetType() { + return streetType; + } + + public void setStreetType(String streetType) { + this.streetType = streetType; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,7 +219,7 @@ public class GeographicAddress extends BaseRootNamedEntity { && Objects.equals(this.city, geographicAddress.city) && Objects.equals(this.country, geographicAddress.country) && Objects.equals(this.geographicLocation, geographicAddress.geographicLocation) - && Objects.equals(this.geographicSubAddress, geographicAddress.geographicSubAddress) + && Objects.equals(this.geographicSubAddresses, geographicAddress.geographicSubAddresses) && Objects.equals(this.locality, geographicAddress.locality) && Objects.equals(this.postcode, geographicAddress.postcode) && Objects.equals(this.stateOrProvince, geographicAddress.stateOrProvince) @@ -101,7 +237,7 @@ public class GeographicAddress extends BaseRootNamedEntity { @Override public int hashCode() { - return Objects.hash(id, name, city, country, geographicLocation, geographicSubAddress, locality, postcode, stateOrProvince, streetName, streetNr, streetNrLast, streetNrLastSuffix, streetNrSuffix, streetSuffix, streetType, baseType, schemaLocation, type); + return Objects.hash(id, name, city, country, geographicLocation, geographicSubAddresses, locality, postcode, stateOrProvince, streetName, streetNr, streetNrLast, streetNrLastSuffix, streetNrSuffix, streetSuffix, streetType, baseType, schemaLocation, type); } @Override @@ -114,7 +250,7 @@ public class GeographicAddress extends BaseRootNamedEntity { sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); sb.append(" geographicLocation: ").append(toIndentedString(geographicLocation)).append("\n"); - sb.append(" geographicSubAddress: ").append(toIndentedString(geographicSubAddress)).append("\n"); + sb.append(" geographicSubAddress: ").append(toIndentedString(geographicSubAddresses)).append("\n"); sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); sb.append(" postcode: ").append(toIndentedString(postcode)).append("\n"); sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); diff --git a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java index 78c04d1..febbcb4 100644 --- a/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java +++ b/src/main/java/org/etsi/osl/tmf/gam673/model/GeographicAddressValidation.java @@ -8,11 +8,13 @@ import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; import jakarta.validation.Valid; import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.hibernate.annotations.DialectOverride; import org.springframework.validation.annotation.Validated; import java.time.OffsetDateTime; -import java.util.List; +import java.util.HashSet; import java.util.Objects; +import java.util.Set; @Schema(description = "GeographicAddressValidation is a base class for defining the validation of a GeographicAddress.") @Validated @@ -22,7 +24,7 @@ public class GeographicAddressValidation extends BaseRootEntity { @JsonProperty("alternateGeographicAddress") @Valid @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) - private List alternateGeographicAddress; + private Set alternateGeographicAddresses; @JsonProperty("provideAlternative") private Boolean provideAlternative; @@ -39,6 +41,35 @@ public class GeographicAddressValidation extends BaseRootEntity { @JsonProperty("validationResult") private String validationResult; + public GeographicAddress getValidAddress() { + return validAddress; + } + + public void setValidAddress(GeographicAddress validAddress) { + this.validAddress = validAddress; + } + + public Set getAlternateGeographicAddresses() { + return alternateGeographicAddresses; + } + + public void setAlternateGeographicAddresses(Set alternateGeographicAddresses) { + this.alternateGeographicAddresses = alternateGeographicAddresses; + } + + public GeographicAddressValidation alternateGeographicAddress(Set alternateGeographicAddresses) { + this.alternateGeographicAddresses = alternateGeographicAddresses; + return this; + } + + public GeographicAddressValidation addGeographicAddress(GeographicAddress geographicAddress) { + if (this.alternateGeographicAddresses == null) { + this.alternateGeographicAddresses = new HashSet<>(); + } + this.alternateGeographicAddresses.add(geographicAddress); + return this; + } + public Boolean getProvideAlternative() { return provideAlternative; } @@ -81,7 +112,7 @@ public class GeographicAddressValidation extends BaseRootEntity { return false; } GeographicAddressValidation geographicAddressValidation = (GeographicAddressValidation) o; - return Objects.equals(this.alternateGeographicAddress, geographicAddressValidation.alternateGeographicAddress) + return Objects.equals(this.alternateGeographicAddresses, geographicAddressValidation.alternateGeographicAddresses) && Objects.equals(this.provideAlternative, geographicAddressValidation.provideAlternative) && Objects.equals(this.status, geographicAddressValidation.status) && Objects.equals(this.validAddress, geographicAddressValidation.validAddress) @@ -94,7 +125,7 @@ public class GeographicAddressValidation extends BaseRootEntity { @Override public int hashCode() { - return Objects.hash(alternateGeographicAddress, provideAlternative, status, validAddress, validationDate, validationResult, baseType, schemaLocation, type); + return Objects.hash(alternateGeographicAddresses, provideAlternative, status, validAddress, validationDate, validationResult, baseType, schemaLocation, type); } @Override @@ -102,7 +133,7 @@ public class GeographicAddressValidation extends BaseRootEntity { StringBuilder sb = new StringBuilder(); sb.append("class geographicAddressValidation {\n"); - sb.append(" alternateGeographicAddress: ").append(toIndentedString(alternateGeographicAddress)).append("\n"); + sb.append(" alternateGeographicAddress: ").append(toIndentedString(alternateGeographicAddresses)).append("\n"); sb.append(" provideAlternative: ").append(toIndentedString(provideAlternative)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" validAddress: ").append(toIndentedString(validAddress)).append("\n"); -- GitLab