From b50314c480956f19c4bbf3abbfc8107e1b2f6c66 Mon Sep 17 00:00:00 2001 From: mlm483 <128052931+mlm483@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:39:07 -0400 Subject: [PATCH 1/3] [BI-2208] - implemented hashCode, equals and toString for BrAPIGermplasmStorageTypes --- .../germ/BrAPIGermplasmStorageTypes.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java b/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java index bc988100..1fa6cadd 100644 --- a/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java +++ b/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java @@ -1,5 +1,7 @@ package org.brapi.v2.model.germ; +import java.util.Objects; + public class BrAPIGermplasmStorageTypes { private BrAPIGermplasmStorageTypesEnum code; private String description; @@ -25,4 +27,31 @@ public String getDescription() { return description; } + public boolean equals(Object o) { + if (this == o) { + return true; + } else if (o != null && this.getClass() == o.getClass()) { + BrAPIGermplasmStorageTypes germplasmStorageType = (BrAPIGermplasmStorageTypes)o; + return Objects.equals(this.code, germplasmStorageType.code) && Objects.equals(this.description, germplasmStorageType.description); + } else { + return false; + } + } + + public int hashCode() { + return Objects.hash(this.code, this.description); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BrAPIGermplasmStorageTypes {\n"); + sb.append(" code: ").append(this.toIndentedString(this.code)).append("\n"); + sb.append(" description: ").append(this.toIndentedString(this.description)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } } From 23c09f83ae7bc62347b883ab80021c9515b85f42 Mon Sep 17 00:00:00 2001 From: mlm483 <128052931+mlm483@users.noreply.github.com> Date: Fri, 12 Jul 2024 08:54:47 -0400 Subject: [PATCH 2/3] [BI-2208] - simplified toString method --- .../v2/model/germ/BrAPIGermplasmStorageTypes.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java b/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java index 1fa6cadd..f961958a 100644 --- a/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java +++ b/brapi-java-model/src/main/java/org/brapi/v2/model/germ/BrAPIGermplasmStorageTypes.java @@ -43,12 +43,10 @@ public int hashCode() { } public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BrAPIGermplasmStorageTypes {\n"); - sb.append(" code: ").append(this.toIndentedString(this.code)).append("\n"); - sb.append(" description: ").append(this.toIndentedString(this.description)).append("\n"); - sb.append("}"); - return sb.toString(); + return "class BrAPIGermplasmStorageTypes {\n" + + " code: " + this.toIndentedString(this.code) + "\n" + + " description: " + this.toIndentedString(this.description) + "\n" + + "}"; } private String toIndentedString(Object o) { From aac6c7c89193c3f1b5602051a6f68884b9b1a7a8 Mon Sep 17 00:00:00 2001 From: mlm483 <128052931+mlm483@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:11:02 -0400 Subject: [PATCH 3/3] [BI-2208] - added geoJson methods to BrAPIObservation --- .../brapi/v2/model/pheno/BrAPIObservation.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/brapi-java-model/src/main/java/org/brapi/v2/model/pheno/BrAPIObservation.java b/brapi-java-model/src/main/java/org/brapi/v2/model/pheno/BrAPIObservation.java index 6ca10222..cc6440e5 100644 --- a/brapi-java-model/src/main/java/org/brapi/v2/model/pheno/BrAPIObservation.java +++ b/brapi-java-model/src/main/java/org/brapi/v2/model/pheno/BrAPIObservation.java @@ -156,6 +156,21 @@ public void setExternalReferences(List externalReference this.externalReferences = externalReferences; } + public BrAPIObservation geoCoordinates(BrApiGeoJSON geoCoordinates) { + this.geoCoordinates = geoCoordinates; + return this; + } + + /** + * Get geoJson + * @return geoJson + */ + public BrApiGeoJSON getGeoCoordinates() { return geoCoordinates; } + + public void setGeoCoordinates(BrApiGeoJSON geoCoordinates) { + this.geoCoordinates = geoCoordinates; + } + public BrAPIObservation germplasmDbId(String germplasmDbId) { this.germplasmDbId = germplasmDbId; return this;