blob: d8f15040349a76a3ffc294196b36bb639ba14811 [file] [log] [blame]
janani bf41dec32017-03-24 18:44:07 +05301/*
2 * Copyright 2017-present 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 */
16
17package org.onosproject.l3vpn.netl3vpn;
18
19import com.google.common.base.Objects;
20
21/**
22 * Representation of site network access information.
23 */
24public class AccessInfo {
25
26 /**
27 * Site id from sites list.
28 */
29 private String siteId;
30
31 /**
32 * Site network access id from site network access list.
33 */
34 private String accessId;
35
36 /**
37 * Constructs access info with site id and access id.
38 *
39 * @param s site id
40 * @param a access id
41 */
42 public AccessInfo(String s, String a) {
43 siteId = s;
44 accessId = a;
45 }
46
47 /**
48 * Returns the site id.
49 *
50 * @return site id
51 */
janani b35f6cbc2017-03-24 21:56:58 +053052 public String siteId() {
janani bf41dec32017-03-24 18:44:07 +053053 return siteId;
54 }
55
56 /**
57 * Returns the access id.
58 *
59 * @return access id
60 */
janani b35f6cbc2017-03-24 21:56:58 +053061 public String accessId() {
janani bf41dec32017-03-24 18:44:07 +053062 return accessId;
63 }
64
65 @Override
66 public int hashCode() {
67 return Objects.hashCode(siteId, accessId);
68 }
69
70 @Override
71 public boolean equals(Object object) {
72 if (this == object) {
73 return true;
74 }
75 if (object instanceof AccessInfo) {
76 AccessInfo that = (AccessInfo) object;
77 return Objects.equal(siteId, that.siteId) &&
78 Objects.equal(accessId, that.accessId);
79 }
80 return false;
81 }
82
83 @Override
84 public String toString() {
85 return "Access id : " + accessId + "\nSite id : " + siteId;
86 }
87}