blob: 0e9eaa8081162833e5fbfd2e733be4df46af9ea3 [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
2 * Copyright 2017-present Open Networking Foundation
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 */
16package org.onosproject.incubator.net.l2monitoring.cfm.identifier;
17
18/**
19 * A representation of NONE as an MA identifier.
20 */
21public class MdIdNone implements MdId {
22
23 @Override
24 public String mdName() {
25 return null;
26 }
27
28 @Override
29 public String toString() {
30 return "";
31 }
32
33 @Override
34 public int getNameLength() {
35 return 0;
36 }
37
38 @Override
39 public MdNameType nameType() {
40 return MdNameType.NONE;
41 }
42
43 public static MdId asMdId() {
44 return new MdIdNone();
45 }
46
47 @Override
48 public boolean equals(Object obj) {
49 if (obj instanceof MdIdNone) {
50 return true;
51 }
52 return false;
53 }
54
55 @Override
56 public int hashCode() {
57 return super.hashCode();
58 }
59}