1 package org.openecomp.sdc.vendorlicense.dao.types;
3 import org.openecomp.sdc.versioning.dao.types.Version;
4 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
6 import java.util.Objects;
8 public class LimitEntity implements VersionableEntity {
9 private static final String ENTITY_TYPE = "Limit";
12 private String vendorLicenseModelId;
13 private String epLkgId;
15 private LimitType type;
16 private String description;
17 private String metric;
18 private Version version;
21 private AggregationFunction aggregationFunction;
23 //Defined and used only to find parent(EP/LKG) of Limit. Not to be persisted in DB and License
25 private String parent;
27 public LimitEntity() {
30 public LimitEntity(String vlmId, Version version, String epLkgId, String id) {
31 this.vendorLicenseModelId = vlmId;
32 this.version = version;
33 this.epLkgId = epLkgId;
37 public String getUnit() {
41 public void setUnit(String unit) {
45 public AggregationFunction getAggregationFunction() {
46 return aggregationFunction;
49 public void setAggregationFunction(
50 AggregationFunction aggregationFunction) {
51 this.aggregationFunction = aggregationFunction;
54 public String getTime() {
58 public void setTime(String time) {
64 public String getEntityType() {
69 public String getFirstClassCitizenId() {
70 return getVendorLicenseModelId();
74 public String getId() {
79 public void setId(String id) {
84 public Version getVersion() {
88 public String getEpLkgId() {
92 public void setEpLkgId(String epLkgId) {
93 this.epLkgId = epLkgId;
97 public void setVersion(Version version) {
98 this.version = version;
101 public String getVendorLicenseModelId() {
102 return vendorLicenseModelId;
105 public void setVendorLicenseModelId(String vendorLicenseModelId) {
106 this.vendorLicenseModelId = vendorLicenseModelId;
109 public LimitType getType() {
113 public void setType(LimitType type) {
117 public String getName() {
121 public void setName(String name) {
125 public String getMetric() {
129 public void setMetric(String metric) {
130 this.metric = metric;
133 public String getDescription() {
137 public void setDescription(String description) {
138 this.description = description;
141 public String getValue() {
145 public void setValue(String value) {
149 //Defined and used only to find parent(EP/LKG) of Limit. Not to be persisted in DB and License
151 public String getParent() {
155 public void setParent(String parent) {
156 this.parent = parent;
160 public int hashCode() {
161 return Objects.hash(vendorLicenseModelId, version, epLkgId, id, name, description, type,
162 metric, unit, time, aggregationFunction, value);
166 public boolean equals(Object obj) {
170 if (obj == null || getClass() != obj.getClass()) {
173 LimitEntity that = (LimitEntity) obj;
174 return Objects.equals(that.unit, unit)
175 && Objects.equals(that.value, value)
176 && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
177 && Objects.equals(epLkgId, that.epLkgId)
178 && Objects.equals(id, that.id)
179 && Objects.equals(name, that.name)
180 && Objects.equals(description, that.description)
181 && Objects.equals(type, that.type)
182 && Objects.equals(metric, that.metric)
183 && Objects.equals(aggregationFunction, that.aggregationFunction);
188 public String toString() {
189 return "LimitEntity{"
190 + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
191 + ", version=" + version
192 + ", epLkgId=" + epLkgId
193 + ", id='" + id + '\''
194 + ", name='" + name + '\''
195 + ", description='" + description + '\''
197 + ", metric=" + metric
198 + ", value='" + value + '\''
199 + ", unit='" + unit + '\''
200 + ", aggregationFunction=" + aggregationFunction