CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +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 | package org.onosproject.ovsdb.controller; |
| 17 | |
Jian Li | 597d7b2 | 2016-02-29 14:06:55 -0800 | [diff] [blame] | 18 | import org.onlab.util.Identifier; |
| 19 | |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 20 | import static com.google.common.base.Preconditions.checkNotNull; |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 21 | |
| 22 | /** |
BitOhenry | d50bf82 | 2015-10-26 13:52:57 +0800 | [diff] [blame] | 23 | * The class representing a datapathid. |
| 24 | * This class is immutable. |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 25 | */ |
Jian Li | 597d7b2 | 2016-02-29 14:06:55 -0800 | [diff] [blame] | 26 | public final class OvsdbDatapathId extends Identifier<String> { |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 27 | /** |
BitOhenry | d50bf82 | 2015-10-26 13:52:57 +0800 | [diff] [blame] | 28 | * Constructor from a String. |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 29 | * |
| 30 | * @param value the datapathid to use |
| 31 | */ |
| 32 | public OvsdbDatapathId(String value) { |
Jian Li | 597d7b2 | 2016-02-29 14:06:55 -0800 | [diff] [blame] | 33 | super(checkNotNull(value, "value is not null")); |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | /** |
BitOhenry | d50bf82 | 2015-10-26 13:52:57 +0800 | [diff] [blame] | 37 | * Gets the value of datapathid. |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 38 | * |
BitOhenry | d50bf82 | 2015-10-26 13:52:57 +0800 | [diff] [blame] | 39 | * @return the value of datapathid |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 40 | */ |
| 41 | public String value() { |
Jian Li | 597d7b2 | 2016-02-29 14:06:55 -0800 | [diff] [blame] | 42 | return identifier; |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 43 | } |
| 44 | } |