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] [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 "); + } }