samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.net.behaviour; |
| 18 | |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 19 | import com.google.common.annotations.Beta; |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 20 | import com.google.common.base.MoreObjects; |
Hyunsun Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 21 | import org.onlab.packet.IpAddress; |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Represent for a tunnel point using ip address. |
Hyunsun Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 25 | * |
| 26 | * @deprecated version 1.7.0 - Hummingbird; use {@code TunnelEndPoint<IpAddress>} |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 27 | */ |
Hyunsun Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 28 | @Deprecated |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 29 | @Beta |
Hyunsun Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 30 | public final class IpTunnelEndPoint extends TunnelEndPoint<IpAddress> { |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Public construction is prohibited. |
| 34 | * @param ip ip address |
| 35 | */ |
| 36 | private IpTunnelEndPoint(IpAddress ip) { |
Hyunsun Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 37 | super(ip); |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 38 | } |
| 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 Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 54 | return value; |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public String toString() { |
Hyunsun Moon | dd14e8e | 2016-06-09 16:17:32 -0700 | [diff] [blame] | 59 | return MoreObjects.toStringHelper(getClass()).add("ip", value).toString(); |
samuel | bc087c0 | 2015-07-23 14:11:58 +0800 | [diff] [blame] | 60 | } |
| 61 | } |