blob: 208383db946a34426cfa9ecfe1fe99741f53af22 [file] [log] [blame]
Matteo Scandoloaa2adde2021-09-13 12:45:32 -07001/*
2 * Copyright 2021-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.opencord.olt.impl;
18
19import org.onosproject.net.meter.MeterCellId;
20import org.onosproject.net.meter.MeterId;
21import org.onosproject.net.meter.MeterState;
22
23import java.util.Objects;
24
25/**
26 * Class containing Meter Data.
27 */
28public class MeterData {
29 private MeterCellId meterCellId;
30 private MeterState meterStatus;
31 private String bandwidthProfileName;
32
33 public MeterData(MeterCellId meterCellId, MeterState meterStatus, String bandwidthProfile) {
34 this.meterCellId = meterCellId;
35 this.meterStatus = meterStatus;
36 this.bandwidthProfileName = bandwidthProfile;
37 }
38
39 public void setMeterCellId(MeterCellId meterCellId) {
40 this.meterCellId = meterCellId;
41 }
42
43 public void setMeterStatus(MeterState meterStatus) {
44 this.meterStatus = meterStatus;
45 }
46
47 public MeterId getMeterId() {
48 return (MeterId) meterCellId;
49 }
50
51 public MeterCellId getMeterCellId() {
52 return meterCellId;
53 }
54
55 public MeterState getMeterStatus() {
56 return meterStatus;
57 }
58
59 public String getBandwidthProfileName() {
60 return bandwidthProfileName;
61 }
62
63 @Override
64 public boolean equals(Object o) {
65 if (this == o) {
66 return true;
67 }
68 if (o == null || getClass() != o.getClass()) {
69 return false;
70 }
71 MeterData meterData = (MeterData) o;
72 return Objects.equals(meterCellId, meterData.meterCellId) &&
73 meterStatus == meterData.meterStatus &&
74 Objects.equals(bandwidthProfileName, meterData.bandwidthProfileName);
75 }
76
77 @Override
78 public int hashCode() {
79 return Objects.hash(meterCellId, meterStatus, bandwidthProfileName);
80 }
81
82 @Override
83 public String toString() {
84 return "MeterData{" +
85 "meterCellId=" + meterCellId +
86 ", meterStatus=" + meterStatus +
87 ", bandwidthProfile='" + bandwidthProfileName + '\'' +
88 '}';
89 }
90}