blob: 2b622e3ce70305a25c4f25e3595bf81ab38de4fe [file] [log] [blame]
samuelbc087c02015-07-23 14:11:58 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
samuelbc087c02015-07-23 14:11:58 +08003 *
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.net.behaviour;
18
samuelbc087c02015-07-23 14:11:58 +080019import com.google.common.annotations.Beta;
samuelbc087c02015-07-23 14:11:58 +080020import com.google.common.base.MoreObjects;
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070021import org.onlab.packet.IpAddress;
samuelbc087c02015-07-23 14:11:58 +080022
23/**
24 * Represent for a tunnel point using ip address.
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070025 *
26 * @deprecated version 1.7.0 - Hummingbird; use {@code TunnelEndPoint<IpAddress>}
samuelbc087c02015-07-23 14:11:58 +080027 */
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070028@Deprecated
samuelbc087c02015-07-23 14:11:58 +080029@Beta
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070030public final class IpTunnelEndPoint extends TunnelEndPoint<IpAddress> {
samuelbc087c02015-07-23 14:11:58 +080031
32 /**
33 * Public construction is prohibited.
34 * @param ip ip address
35 */
36 private IpTunnelEndPoint(IpAddress ip) {
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070037 super(ip);
samuelbc087c02015-07-23 14:11:58 +080038 }
39
40 /**
41 * Create a IP tunnel end point.
42 * @param ip IP address
43 * @return IpTunnelEndPoint
44 */
45 public static IpTunnelEndPoint ipTunnelPoint(IpAddress ip) {
46 return new IpTunnelEndPoint(ip);
47 }
48
49 /**
50 * Returns IP address.
51 * @return IP address
52 */
53 public IpAddress ip() {
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070054 return value;
samuelbc087c02015-07-23 14:11:58 +080055 }
56
57 @Override
58 public String toString() {
Hyunsun Moondd14e8e2016-06-09 16:17:32 -070059 return MoreObjects.toStringHelper(getClass()).add("ip", value).toString();
samuelbc087c02015-07-23 14:11:58 +080060 }
61}