blob: 319c4f680ec6c3706758bc52f231aef192f1a5f1 [file] [log] [blame]
Satish Kf6d87cb2015-11-30 19:59:22 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Satish Kf6d87cb2015-11-30 19:59:22 +05303 *
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.iptopology.api;
17
18import static com.google.common.base.MoreObjects.toStringHelper;
19
20import java.util.Objects;
21
22/**
23 * Represents signaling protocols that are enabled.
24 */
25public class Signalling {
26 private final Boolean ldp;
27 private final Boolean rsvpte;
28
29 /**
30 * Constructor to initialize the values.
31 *
32 * @param ldp Label Distribution Protocol whether enabled or not
33 * @param rsvpte RSVP TE whether enabled or not
34 */
35 public Signalling(Boolean ldp, Boolean rsvpte) {
36 this.ldp = ldp;
37 this.rsvpte = rsvpte;
38 }
39
40 /**
41 * Obtains whether LDP signalling protocol is enabled or not.
42 *
43 * @return LDP signalling protocol is enabled or not
44 */
45 public Boolean ldp() {
46 return ldp;
47 }
48
49 /**
50 * Obtains whether rsvp-te signalling protocol is enabled or not.
51 *
52 * @return rsvp-te signalling protocol is enabled or not
53 */
54 public Boolean rsvpte() {
55 return rsvpte;
56 }
57
58 @Override
59 public int hashCode() {
60 return Objects.hash(ldp, rsvpte);
61 }
62
63 @Override
64 public boolean equals(Object obj) {
65 if (this == obj) {
66 return true;
67 }
68
69 if (obj instanceof Signalling) {
70 Signalling other = (Signalling) obj;
71 return Objects.equals(ldp, other.ldp) && Objects.equals(rsvpte, other.rsvpte);
72 }
73 return false;
74 }
75
76 @Override
77 public String toString() {
78 return toStringHelper(this)
79 .add("ldp", ldp)
80 .add("rsvpte", rsvpte)
81 .toString();
82 }
83}