Increase test coverage of AppStatsManager
[portal/ric-dashboard.git] / dashboard / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / model / AppStats.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2020 AT&T Intellectual Property
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20 package org.oransc.ric.portal.dashboard.model;
21
22 import java.util.Objects;
23
24 public class AppStats implements IDashboardResponse {
25         private String instanceKey;
26         private StatsDetailsTransport statsDetails;
27
28         public AppStats() {
29                 super();
30         }
31
32         public AppStats(String instanceKey, StatsDetailsTransport statsDetails) {
33                 super();
34                 this.instanceKey = instanceKey;
35                 this.statsDetails = statsDetails;
36         }
37
38         public StatsDetailsTransport getStatsDetails() {
39                 return statsDetails;
40         }
41
42         public void setStatsDetails(StatsDetailsTransport statsDetails) {
43                 this.statsDetails = statsDetails;
44         }
45
46         public String getInstanceKey() {
47                 return instanceKey;
48         }
49
50         public void setInstanceKey(String instanceKey) {
51                 this.instanceKey = instanceKey;
52         }
53
54         @Override
55         public String toString() {
56                 return this.getClass().getSimpleName() + "[instance=" + instanceKey + ", statsDetails=" + statsDetails + "]";
57         }
58
59         @Override
60         public boolean equals(Object obj) {
61                 if (this == obj)
62                         return true;
63                 if (obj == null)
64                         return false;
65                 if (getClass() != obj.getClass())
66                         return false;
67                 AppStats other = (AppStats) obj;
68                 return Objects.equals(instanceKey, other.instanceKey) && Objects.equals(statsDetails, other.statsDetails);
69         }
70
71 }