[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-license-lib / openecomp-sdc-vendor-license-api / src / main / java / org / openecomp / sdc / vendorlicense / dao / types / LimitEntity.java
1 package org.openecomp.sdc.vendorlicense.dao.types;
2
3 import org.openecomp.sdc.versioning.dao.types.Version;
4 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
5
6 import java.util.Objects;
7
8 public class LimitEntity implements VersionableEntity {
9   private static final String ENTITY_TYPE = "Limit";
10
11   private String id;
12   private String vendorLicenseModelId;
13   private String epLkgId;
14   private String name;
15   private LimitType type;
16   private String description;
17   private EntitlementMetric metric;
18   private Version version;
19   private Integer value;
20   private Integer unit;
21   private AggregationFunction aggregationFunction;
22   private EntitlementTime time;
23
24   public LimitEntity() {
25   }
26
27   public LimitEntity(String vlmId, Version version, String epLkgId, String id) {
28     this.vendorLicenseModelId = vlmId;
29     this.version = version;
30     this.epLkgId = epLkgId;
31     this.id = id;
32   }
33
34   public Integer getUnit() {
35     return unit;
36   }
37
38   public void setUnit(Integer unit) {
39     this.unit = unit;
40   }
41
42   public AggregationFunction getAggregationFunction() {
43     return aggregationFunction;
44   }
45
46   public void setAggregationFunction(
47       AggregationFunction aggregationFunction) {
48     this.aggregationFunction = aggregationFunction;
49   }
50
51   public EntitlementTime getTime() {
52     return time;
53   }
54
55   public void setTime(EntitlementTime time) {
56     this.time = time;
57   }
58
59
60   @Override
61   public String getEntityType() {
62     return ENTITY_TYPE;
63   }
64
65   @Override
66   public String getFirstClassCitizenId() {
67     return getVendorLicenseModelId();
68   }
69
70   @Override
71   public String getId() {
72     return id;
73   }
74
75   @Override
76   public void setId(String id) {
77     this.id = id;
78   }
79
80   @Override
81   public Version getVersion() {
82     return version;
83   }
84
85   public String getEpLkgId() {
86     return epLkgId;
87   }
88
89   public void setEpLkgId(String epLkgId) {
90     this.epLkgId = epLkgId;
91   }
92
93   @Override
94   public void setVersion(Version version) {
95     this.version = version;
96   }
97
98   public String getVendorLicenseModelId() {
99     return vendorLicenseModelId;
100   }
101
102   public void setVendorLicenseModelId(String vendorLicenseModelId) {
103     this.vendorLicenseModelId = vendorLicenseModelId;
104   }
105
106   public LimitType getType() {
107     return type;
108   }
109
110   public void setType(LimitType type) {
111     this.type = type;
112   }
113
114   public String getName() {
115     return name;
116   }
117
118   public void setName(String name) {
119     this.name = name;
120   }
121
122   public EntitlementMetric getMetric() {
123     return metric;
124   }
125
126   public void setMetric(EntitlementMetric metric) {
127     this.metric = metric;
128   }
129
130   public String getDescription() {
131     return description;
132   }
133
134   public void setDescription(String description) {
135     this.description = description;
136   }
137
138   public Integer getValue() {
139     return value;
140   }
141
142   public void setValue(Integer value) {
143     this.value = value;
144   }
145
146    @Override
147   public int hashCode() {
148     return Objects.hash(vendorLicenseModelId, version, epLkgId, id, name, description, type,
149         metric, unit, time, aggregationFunction, value);
150   }
151
152   @Override
153   public boolean equals(Object obj) {
154     if (this == obj) {
155       return true;
156     }
157     if (obj == null || getClass() != obj.getClass()) {
158       return false;
159     }
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);
171
172   }
173
174   @Override
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 + '\''
183         + ", type=" + type
184         + ", metric=" + metric
185         + ", value='" + value + '\''
186         + ", unit='" + unit + '\''
187         + ", aggregationFunction=" + aggregationFunction
188         + ", time=" + time
189
190         + '}';
191   }
192
193 }