2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.sal.core;
11 import org.apache.commons.lang3.builder.HashCodeBuilder;
12 import org.apache.commons.lang3.builder.EqualsBuilder;
13 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
15 import javax.xml.bind.annotation.XmlRootElement;
16 import javax.xml.bind.annotation.XmlElement;
19 * The class represents Admin Config status
24 @SuppressWarnings("serial")
25 public class Config extends Property {
27 private short configValue;
29 public static final short ADMIN_DOWN = 0;
30 public static final short ADMIN_UP = 1;
31 public static final short ADMIN_UNDEF = 0x7fff;
32 public static final String ConfigPropName = "config";
35 * Private constructor used for JAXB mapping
38 super(ConfigPropName);
39 this.configValue = ADMIN_UNDEF;
42 public Config(short config) {
43 super(ConfigPropName);
44 this.configValue = config;
47 public Config clone() {
48 return new Config(this.configValue);
51 public short getValue() {
52 return this.configValue;
56 public int hashCode() {
57 return HashCodeBuilder.reflectionHashCode(this);
61 public boolean equals(Object obj) {
62 return EqualsBuilder.reflectionEquals(this, obj);
66 public String toString() {
67 StringBuffer ret = new StringBuffer();
68 if (this.configValue == 0) {
70 } else if (this.configValue == 1) {
73 ret.append("Undefined");
75 return ret.toString();