rsanchez
2017-03-24 4f5711b8ec555ab8307516ce178b454445d3833f
securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java
....@@ -1,6 +1,7 @@
11 package net.curisit.securis.db;
22
33 import java.io.Serializable;
4
+import java.util.Objects;
45
56 import javax.persistence.Column;
67 import javax.persistence.Entity;
....@@ -17,6 +18,8 @@
1718 import com.fasterxml.jackson.annotation.JsonInclude;
1819 import com.fasterxml.jackson.annotation.JsonInclude.Include;
1920
21
+import net.curisit.securis.db.common.Metadata;
22
+
2023 /**
2124 * Entity implementation class for Entity: licensetype_metadata
2225 *
....@@ -27,7 +30,7 @@
2730 @Table(name = "licensetype_metadata")
2831 @JsonIgnoreProperties(ignoreUnknown = true)
2932 @NamedQueries({ @NamedQuery(name = "list-licensetype-metadata", query = "SELECT a FROM LicenseTypeMetadata a where a.licenseType.id = :licenseTypeId") })
30
-public class LicenseTypeMetadata implements Serializable {
33
+public class LicenseTypeMetadata implements Serializable, Metadata {
3134
3235 private static final long serialVersionUID = 1L;
3336
....@@ -76,4 +79,22 @@
7679 public void setMandatory(boolean mandatory) {
7780 this.mandatory = mandatory;
7881 }
82
+
83
+ @Override
84
+ public boolean equals(Object obj) {
85
+ if (!(obj instanceof LicenseTypeMetadata))
86
+ return false;
87
+ LicenseTypeMetadata other = (LicenseTypeMetadata) obj;
88
+ return Objects.equals(key, other.key) && Objects.equals(licenseType, other.licenseType);
89
+ }
90
+
91
+ @Override
92
+ public int hashCode() {
93
+ return Objects.hash(key, licenseType);
94
+ }
95
+
96
+ @Override
97
+ public String toString() {
98
+ return String.format("LTMD (%s: %s)", key, value);
99
+ }
79100 }