Skip to content

Commit

Permalink
[BI-2208] - implemented hashCode, equals and toString for BrAPIGermpl…
Browse files Browse the repository at this point in the history
…asmStorageTypes
  • Loading branch information
mlm483 committed Jul 11, 2024
1 parent 5ddffdd commit b50314c
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.brapi.v2.model.germ;

import java.util.Objects;

public class BrAPIGermplasmStorageTypes {
private BrAPIGermplasmStorageTypesEnum code;
private String description;
Expand All @@ -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 ");
}
}

0 comments on commit b50314c

Please sign in to comment.