blob: cfc1402383d4dce32de855687b1c4724da38e362 [file] [log] [blame]
alshabibeadfc8e2015-08-18 15:40:46 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.incubator.store.meter.impl;
17
18import org.onosproject.cluster.NodeId;
19import org.onosproject.incubator.net.meter.Meter;
20import org.onosproject.incubator.net.meter.MeterFailReason;
21
22import java.util.Optional;
23
24/**
25 * A class representing the meter information stored in the meter store.
26 */
27public class MeterData {
28
29 private final Meter meter;
30 private final Optional<MeterFailReason> reason;
31 private final NodeId origin;
32
33 public MeterData(Meter meter, MeterFailReason reason, NodeId origin) {
34 this.meter = meter;
35 this.reason = Optional.ofNullable(reason);
36 this.origin = origin;
37 }
38
39 public Meter meter() {
40 return meter;
41 }
42
43 public Optional<MeterFailReason> reason() {
44 return this.reason;
45 }
46
47 public NodeId origin() {
48 return this.origin;
49 }
50
51
52}