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 EntitlementMetric metric;
18 private Version version;
19 private Integer value;
21 private AggregationFunction aggregationFunction;
22 private EntitlementTime time;
24 public LimitEntity() {
27 public LimitEntity(String vlmId, Version version, String epLkgId, String id) {
28 this.vendorLicenseModelId = vlmId;
29 this.version = version;
30 this.epLkgId = epLkgId;
34 public Integer getUnit() {
38 public void setUnit(Integer unit) {
42 public AggregationFunction getAggregationFunction() {
43 return aggregationFunction;
46 public void setAggregationFunction(
47 AggregationFunction aggregationFunction) {
48 this.aggregationFunction = aggregationFunction;
51 public EntitlementTime getTime() {
55 public void setTime(EntitlementTime time) {
61 public String getEntityType() {
66 public String getFirstClassCitizenId() {
67 return getVendorLicenseModelId();
71 public String getId() {
76 public void setId(String id) {
81 public Version getVersion() {
85 public String getEpLkgId() {
89 public void setEpLkgId(String epLkgId) {
90 this.epLkgId = epLkgId;
94 public void setVersion(Version version) {
95 this.version = version;
98 public String getVendorLicenseModelId() {
99 return vendorLicenseModelId;
102 public void setVendorLicenseModelId(String vendorLicenseModelId) {
103 this.vendorLicenseModelId = vendorLicenseModelId;
106 public LimitType getType() {
110 public void setType(LimitType type) {
114 public String getName() {
118 public void setName(String name) {
122 public EntitlementMetric getMetric() {
126 public void setMetric(EntitlementMetric metric) {
127 this.metric = metric;
130 public String getDescription() {
134 public void setDescription(String description) {
135 this.description = description;
138 public Integer getValue() {
142 public void setValue(Integer value) {
147 public int hashCode() {
148 return Objects.hash(vendorLicenseModelId, version, epLkgId, id, name, description, type,
149 metric, unit, time, aggregationFunction, value);
153 public boolean equals(Object obj) {
157 if (obj == null || getClass() != obj.getClass()) {
160 LimitEntity that = (LimitEntity) obj;
161 return Objects.equals(that.unit, unit)
162 && Objects.equals(that.value, value)
163 && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
164 && Objects.equals(epLkgId, that.epLkgId)
165 && Objects.equals(id, that.id)
166 && Objects.equals(name, that.name)
167 && Objects.equals(description, that.description)
168 && Objects.equals(type, that.type)
169 && Objects.equals(metric, that.metric)
170 && Objects.equals(aggregationFunction, that.aggregationFunction);
175 public String toString() {
176 return "LimitEntity{"
177 + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
178 + ", version=" + version
179 + ", epLkgId=" + epLkgId
180 + ", id='" + id + '\''
181 + ", name='" + name + '\''
182 + ", description='" + description + '\''
184 + ", metric=" + metric
185 + ", value='" + value + '\''
186 + ", unit='" + unit + '\''
187 + ", aggregationFunction=" + aggregationFunction