-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.data.util;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collection;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.data.api.CompositeNode;\r
-import org.opendaylight.controller.yang.data.api.Node;\r
-import org.opendaylight.controller.yang.data.api.SimpleNode;\r
-\r
-public abstract class AbstractContainerNode extends AbstractNode<List<Node<?>>>\r
- implements CompositeNode {\r
-\r
- public SimpleNode<?> getFirstSimpleByName(QName leaf) {\r
- List<SimpleNode<?>> list = getSimpleNodesByName(leaf);\r
- if (list.size() == 0)\r
- return null;\r
- return list.get(0);\r
- }\r
-\r
- protected AbstractContainerNode(QName name, CompositeNode parent) {\r
- super(name, parent);\r
- }\r
-\r
- public AbstractContainerNode(QName name) {\r
- super(name, null);\r
- }\r
-\r
- public List<Node<?>> getChildren() {\r
- return getValue();\r
- }\r
-\r
- public List<Node<?>> getValue() {\r
- Map<QName, List<Node<?>>> map = getNodeMap();\r
- if (map == null)\r
- throw new IllegalStateException("nodeMap should not be null");\r
- List<Node<?>> ret = new ArrayList<Node<?>>();\r
- Collection<List<Node<?>>> values = map.values();\r
- for (List<Node<?>> list : values) {\r
- ret.addAll(list);\r
- }\r
- return ret;\r
- }\r
-\r
- protected abstract Map<QName, List<Node<?>>> getNodeMap();\r
-\r
- public List<CompositeNode> getCompositesByName(QName children) {\r
- Map<QName, List<Node<?>>> map = getNodeMap();\r
- if (map == null)\r
- throw new IllegalStateException("nodeMap should not be null");\r
- List<Node<?>> toFilter = map.get(children);\r
- List<CompositeNode> list = new ArrayList<CompositeNode>();\r
- for (Node<?> node : toFilter) {\r
- if (node instanceof CompositeNode)\r
- list.add((CompositeNode) node);\r
- }\r
- return list;\r
- }\r
-\r
- public List<SimpleNode<?>> getSimpleNodesByName(QName children) {\r
- Map<QName, List<Node<?>>> map = getNodeMap();\r
- if (map == null)\r
- throw new IllegalStateException("nodeMap should not be null");\r
- List<Node<?>> toFilter = map.get(children);\r
- List<SimpleNode<?>> list = new ArrayList<SimpleNode<?>>();\r
-\r
- for (Node<?> node : toFilter) {\r
- if (node instanceof SimpleNode<?>)\r
- list.add((SimpleNode<?>) node);\r
- }\r
- return list;\r
- }\r
-\r
- public CompositeNode getFirstCompositeByName(QName container) {\r
- List<CompositeNode> list = getCompositesByName(container);\r
- if (list.size() == 0)\r
- return null;\r
- return list.get(0);\r
- }\r
-\r
- public SimpleNode<?> getFirstLeafByName(QName leaf) {\r
- List<SimpleNode<?>> list = getSimpleNodesByName(leaf);\r
- if (list.size() == 0)\r
- return null;\r
- return list.get(0);\r
- }\r
-\r
- public List<CompositeNode> getCompositesByName(String children) {\r
- return getCompositesByName(localQName(children));\r
- }\r
-\r
- public List<SimpleNode<?>> getSimpleNodesByName(String children) {\r
- return getSimpleNodesByName(localQName(children));\r
- }\r
-\r
- private QName localQName(String str) {\r
- return new QName(getNodeType(), str);\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.data.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.data.api.CompositeNode;
+import org.opendaylight.controller.yang.data.api.Node;
+import org.opendaylight.controller.yang.data.api.SimpleNode;
+
+public abstract class AbstractContainerNode extends AbstractNode<List<Node<?>>>
+ implements CompositeNode {
+
+ public SimpleNode<?> getFirstSimpleByName(QName leaf) {
+ List<SimpleNode<?>> list = getSimpleNodesByName(leaf);
+ if (list.size() == 0)
+ return null;
+ return list.get(0);
+ }
+
+ protected AbstractContainerNode(QName name, CompositeNode parent) {
+ super(name, parent);
+ }
+
+ public AbstractContainerNode(QName name) {
+ super(name, null);
+ }
+
+ public List<Node<?>> getChildren() {
+ return getValue();
+ }
+
+ public List<Node<?>> getValue() {
+ Map<QName, List<Node<?>>> map = getNodeMap();
+ if (map == null)
+ throw new IllegalStateException("nodeMap should not be null");
+ List<Node<?>> ret = new ArrayList<Node<?>>();
+ Collection<List<Node<?>>> values = map.values();
+ for (List<Node<?>> list : values) {
+ ret.addAll(list);
+ }
+ return ret;
+ }
+
+ protected abstract Map<QName, List<Node<?>>> getNodeMap();
+
+ public List<CompositeNode> getCompositesByName(QName children) {
+ Map<QName, List<Node<?>>> map = getNodeMap();
+ if (map == null)
+ throw new IllegalStateException("nodeMap should not be null");
+ List<Node<?>> toFilter = map.get(children);
+ List<CompositeNode> list = new ArrayList<CompositeNode>();
+ for (Node<?> node : toFilter) {
+ if (node instanceof CompositeNode)
+ list.add((CompositeNode) node);
+ }
+ return list;
+ }
+
+ public List<SimpleNode<?>> getSimpleNodesByName(QName children) {
+ Map<QName, List<Node<?>>> map = getNodeMap();
+ if (map == null)
+ throw new IllegalStateException("nodeMap should not be null");
+ List<Node<?>> toFilter = map.get(children);
+ List<SimpleNode<?>> list = new ArrayList<SimpleNode<?>>();
+
+ for (Node<?> node : toFilter) {
+ if (node instanceof SimpleNode<?>)
+ list.add((SimpleNode<?>) node);
+ }
+ return list;
+ }
+
+ public CompositeNode getFirstCompositeByName(QName container) {
+ List<CompositeNode> list = getCompositesByName(container);
+ if (list.size() == 0)
+ return null;
+ return list.get(0);
+ }
+
+ public SimpleNode<?> getFirstLeafByName(QName leaf) {
+ List<SimpleNode<?>> list = getSimpleNodesByName(leaf);
+ if (list.size() == 0)
+ return null;
+ return list.get(0);
+ }
+
+ public List<CompositeNode> getCompositesByName(String children) {
+ return getCompositesByName(localQName(children));
+ }
+
+ public List<SimpleNode<?>> getSimpleNodesByName(String children) {
+ return getSimpleNodesByName(localQName(children));
+ }
+
+ private QName localQName(String str) {
+ return new QName(getNodeType(), str);
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.data.util;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.data.api.CompositeNode;\r
-import org.opendaylight.controller.yang.data.api.Node;\r
-\r
-public abstract class AbstractNode<T> implements Node<T> {\r
-\r
- private final QName nodeName;\r
- private final CompositeNode parent;\r
-\r
- protected AbstractNode(QName name, CompositeNode parent) {\r
- nodeName = name;\r
- this.parent = parent;\r
- }\r
-\r
- public QName getNodeType() {\r
- return this.nodeName;\r
- }\r
-\r
- public CompositeNode getParent() {\r
- return parent;\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.data.util;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.data.api.CompositeNode;
+import org.opendaylight.controller.yang.data.api.Node;
+
+public abstract class AbstractNode<T> implements Node<T> {
+
+ private final QName nodeName;
+ private final CompositeNode parent;
+
+ protected AbstractNode(QName name, CompositeNode parent) {
+ nodeName = name;
+ this.parent = parent;
+ }
+
+ public QName getNodeType() {
+ return this.nodeName;
+ }
+
+ public CompositeNode getParent() {
+ return parent;
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.data.util;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.data.api.CompositeNode;\r
-import org.opendaylight.controller.yang.data.api.Node;\r
-import org.opendaylight.controller.yang.data.api.SimpleNode;\r
-\r
-public class Nodes {\r
-\r
- private Nodes() {\r
- }\r
-\r
- public static <T> SimpleNode<T> leafNode(QName name, T value) {\r
- return new SimpleNodeTO<T>(name, value, null);\r
- }\r
-\r
- public static CompositeNode containerNode(QName name, List<Node<?>> children) {\r
- return containerNode(name, children, null);\r
- }\r
-\r
- public static CompositeNode containerNode(QName name,\r
- List<Node<?>> children, CompositeNode parent) {\r
- return new ContainerNodeTO(name, parent, nodeMapFromList(children));\r
- }\r
-\r
- public static Map<QName, List<Node<?>>> nodeMapFromList(\r
- List<Node<?>> children) {\r
- Map<QName, List<Node<?>>> map = new HashMap<QName, List<Node<?>>>();\r
- for (Node<?> node : children) {\r
-\r
- QName name = node.getNodeType();\r
- List<Node<?>> targetList = map.get(name);\r
- if (targetList == null) {\r
- targetList = new ArrayList<Node<?>>();\r
- map.put(name, targetList);\r
- }\r
- targetList.add(node);\r
- }\r
- return map;\r
- }\r
-\r
- private static class ContainerNodeTO extends AbstractContainerNode {\r
-\r
- private final Map<QName, List<Node<?>>> nodeMap;\r
-\r
- public ContainerNodeTO(QName name, Map<QName, List<Node<?>>> nodeMap) {\r
- super(name);\r
- this.nodeMap = nodeMap;\r
- }\r
-\r
- public ContainerNodeTO(QName name, CompositeNode parent,\r
- Map<QName, List<Node<?>>> nodeMap) {\r
- super(name, parent);\r
- this.nodeMap = nodeMap;\r
- }\r
-\r
- @Override\r
- protected Map<QName, List<Node<?>>> getNodeMap() {\r
-\r
- return nodeMap;\r
- }\r
- }\r
-\r
- private static class SimpleNodeTO<T> extends AbstractNode<T> implements\r
- SimpleNode<T> {\r
-\r
- private final T value;\r
-\r
- protected SimpleNodeTO(QName name, T val, CompositeNode parent) {\r
- super(name, parent);\r
- value = val;\r
-\r
- }\r
-\r
- @Override\r
- public T getValue() {\r
- return value;\r
- }\r
-\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.data.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.data.api.CompositeNode;
+import org.opendaylight.controller.yang.data.api.Node;
+import org.opendaylight.controller.yang.data.api.SimpleNode;
+
+public class Nodes {
+
+ private Nodes() {
+ }
+
+ public static <T> SimpleNode<T> leafNode(QName name, T value) {
+ return new SimpleNodeTO<T>(name, value, null);
+ }
+
+ public static CompositeNode containerNode(QName name, List<Node<?>> children) {
+ return containerNode(name, children, null);
+ }
+
+ public static CompositeNode containerNode(QName name,
+ List<Node<?>> children, CompositeNode parent) {
+ return new ContainerNodeTO(name, parent, nodeMapFromList(children));
+ }
+
+ public static Map<QName, List<Node<?>>> nodeMapFromList(
+ List<Node<?>> children) {
+ Map<QName, List<Node<?>>> map = new HashMap<QName, List<Node<?>>>();
+ for (Node<?> node : children) {
+
+ QName name = node.getNodeType();
+ List<Node<?>> targetList = map.get(name);
+ if (targetList == null) {
+ targetList = new ArrayList<Node<?>>();
+ map.put(name, targetList);
+ }
+ targetList.add(node);
+ }
+ return map;
+ }
+
+ private static class ContainerNodeTO extends AbstractContainerNode {
+
+ private final Map<QName, List<Node<?>>> nodeMap;
+
+ public ContainerNodeTO(QName name, Map<QName, List<Node<?>>> nodeMap) {
+ super(name);
+ this.nodeMap = nodeMap;
+ }
+
+ public ContainerNodeTO(QName name, CompositeNode parent,
+ Map<QName, List<Node<?>>> nodeMap) {
+ super(name, parent);
+ this.nodeMap = nodeMap;
+ }
+
+ @Override
+ protected Map<QName, List<Node<?>>> getNodeMap() {
+
+ return nodeMap;
+ }
+ }
+
+ private static class SimpleNodeTO<T> extends AbstractNode<T> implements
+ SimpleNode<T> {
+
+ private final T value;
+
+ protected SimpleNodeTO(QName name, T val, CompositeNode parent) {
+ super(name, parent);
+ value = val;
+
+ }
+
+ @Override
+ public T getValue() {
+ return value;
+ }
+
+ }
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-/**\r
- * Definition of structures and DOM Like API of processed YANG schema\r
- * \r
- * <h3>YANG Statement mapping</h3>\r
- * \r
- * <dl>\r
- * <dt>anyxml\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.AnyXmlSchemaNode}\r
- * \r
- * <dt>argument\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ExtensionDefinition#getArgumentName()}\r
- * \r
- * \r
- * <dt>augment\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.AugmentationSchema}\r
- * \r
- * <dt>base\r
- * <dd>{@link org.opendaylight.controller.model.api.type.IdentityrefTypeDefinition#getIdentity()}\r
- * \r
- * <dt>belongs-to\r
- * <dd>\r
- * \r
- * <dt>bit\r
- * <dd>{@link org.opendaylight.controller.model.api.type.BitsTypeDefinition.Bit}\r
- * <dd>{@link org.opendaylight.controller.model.api.type.BitsTypeDefinition#getBits()}\r
- * \r
- * <dt>case\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ChoiceCaseNode}\r
- * \r
- * <dt>choice\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ChoiceNode}\r
- * \r
- * <dt>config\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.DataSchemaNode#isConfiguration()}\r
- * \r
- * <dt>contact\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getContact()}\r
- * \r
- * <dt>container\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ContainerSchemaNode}\r
- * \r
- * <dt>default\r
- * <dd>\r
- * \r
- * <dt>description\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition#getDescription()}\r
- * \r
- * <dt>enum\r
- * <dd>{@link org.opendaylight.controller.model.api.type.EnumTypeDefinition.EnumPair}\r
- * <dd>{@link org.opendaylight.controller.model.api.type.EnumTypeDefinition#getValues()}\r
- * \r
- * <dt>error-app-tag\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition#getErrorAppTag()}\r
- * \r
- * <dt>error-message\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition#getErrorMessage()}\r
- * \r
- * <dt>extension\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ExtensionDefinition}\r
- * \r
- * <dt>deviation\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Deviation}\r
- * \r
- * <dt>deviate\r
- * <dd>\r
- * \r
- * <dt>feature\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.FeatureDefinition}\r
- * \r
- * <dt>fraction-digits\r
- * <dd>{@link org.opendaylight.controller.model.api.type.DecimalTypeDefinition#getFractionDigits()}\r
- * \r
- * <dt>grouping\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.GroupingDefinition}\r
- * \r
- * <dt>identity\r
- * <dd>\r
- * \r
- * <dt>if-feature\r
- * <dd>\r
- * \r
- * <dt>import\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ModuleImport}\r
- * \r
- * <dt>include\r
- * <dd>\r
- * \r
- * <dt>input\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.RpcDefinition#getInput()}\r
- * \r
- * <dt>key\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ListSchemaNode#getKeyDefinition()}\r
- * \r
- * <dt>leaf\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.LeafSchemaNode}\r
- * \r
- * <dt>leaf-list\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.LeafListSchemaNode}\r
- * \r
- * <dt>length\r
- * <dd>{@link org.opendaylight.controller.model.api.type.LengthConstraint}\r
- * <dd>{@link org.opendaylight.controller.model.api.type.StringTypeDefinition#getLengthStatements()}\r
- * \r
- * <dt>list\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ListSchemaNode}\r
- * \r
- * <dt>mandatory\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#isMandatory()}\r
- * \r
- * <dt>max-elements\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getMinElements()}\r
- * \r
- * <dt>min-elements\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getMaxElements()}\r
- * \r
- * <dt>module\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Module}\r
- * \r
- * <dt>must\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getMustConstraints()}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.MustDefinition}\r
- * \r
- * <dt>namespace\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getNamespace()}\r
- * \r
- * <dt>notification\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.NotificationDefinition}\r
- * \r
- * <dt>ordered-by\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ListSchemaNode#isUserOrdered()}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.LeafListSchemaNode#isUserOrdered()}\r
- * \r
- * <dt>organization\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getOrganization()}\r
- * \r
- * <dt>output\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.RpcDefinition#getOutput()}\r
- * \r
- * <dt>path\r
- * <dd>{@link org.opendaylight.controller.model.api.type.LeafrefTypeDefinition#getPathStatement()}\r
- * \r
- * <dt>pattern\r
- * <dd>{@link org.opendaylight.controller.yang.model.base.type.api.PatternConstraint}\r
- * <dd>{@link org.opendaylight.controller.model.api.type.StringTypeDefinition}\r
- * \r
- * <dt>position\r
- * <dd>{@link org.opendaylight.controller.model.api.type.BitsTypeDefinition.Bit#getPosition()}\r
- * \r
- * <dt>prefix\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getPrefix()}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ModuleImport#getPrefix()}\r
- * \r
- * <dt>presence\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ContainerSchemaNode#isPresenceContainer()}\r
- * \r
- * <dt>range\r
- * <dd>{@link org.opendaylight.controller.model.api.type.RangeConstraint}\r
- * <dd>{@link org.opendaylight.controller.model.api.type.IntegerTypeDefinition#getRangeStatements()}\r
- * <dd>{@link org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition#getRangeStatements()}\r
- * \r
- * <dt>reference\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.SchemaNode#getReference()}\r
- * \r
- * <dt>refine\r
- * <dd>\r
- * \r
- * <dt>require-instance\r
- * <dd>{@link org.opendaylight.controller.model.api.type.InstanceIdentifierTypeDefinition#requireInstance()}\r
- * \r
- * <dt>revision\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getRevision()}\r
- * \r
- * <dt>revision-date\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ModuleImport#getRevision()}\r
- * \r
- * <dt>rpc\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.RpcDefinition}\r
- * \r
- * <dt>status\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()}\r
- * \r
- * <dt>submodule\r
- * <dd>\r
- * \r
- * <dt>type\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.TypeDefinition}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.LeafSchemaNode#getType()}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.LeafListSchemaNode#getType()}\r
- * \r
- * <dt>typedef\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.TypeDefinition}\r
- * \r
- * <dt>unique\r
- * <dd>\r
- * \r
- * <dt>units\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()}\r
- * \r
- * <dt>uses\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.UsesNode}\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.DataNodeContainere#getUses()}\r
- * \r
- * <dt>value\r
- * <dd>{@link org.opendaylight.controller.model.api.type.EnumTypeDefinition.EnumPair#getValue()}\r
- * \r
- * <dt>when\r
- * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getWhenCondition()}\r
- * \r
- * <dt>yang-version\r
- * \r
- * <dt>yin-element\r
- * <dd>\r
- * \r
- * \r
- * \r
- * \r
- * <dt>add\r
- * <dd>\r
- * \r
- * <dt>current\r
- * <dd>\r
- * \r
- * <dt>delete\r
- * <dd>\r
- * \r
- * <dt>deprecated\r
- * <dd>\r
- * \r
- * <dt>false\r
- * <dd>\r
- * \r
- * <dt>max\r
- * <dd>\r
- * \r
- * <dt>min\r
- * <dd>\r
- * \r
- * <dt>not-supported\r
- * <dd>\r
- * \r
- * <dt>obsolete\r
- * <dd>\r
- * \r
- * <dt>replace\r
- * <dd>\r
- * \r
- * <dt>system\r
- * <dd>\r
- * \r
- * <dt>true\r
- * <dd>\r
- * \r
- * <dt>unbounded\r
- * <dd>\r
- * \r
- * <dt>user\r
- * <dd>\r
- * </dl>\r
- * \r
- * \r
- * <h3>YANG Base Type Mapping</h3>\r
- * \r
- * \r
- * <dl>\r
- * <dt>Integer built-in type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.IntegerTypeDefinition}\r
- * \r
- * <dt>Unsigned integer built-in type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition}\r
- * \r
- * <dt>Decimal64 built-ib type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.DecimalTypeDefinition}\r
- * \r
- * <dt>Boolean built-in type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.BooleanTypeDefinition}\r
- * \r
- * <dt>Enumeration built-in type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.EnumTypeDefinition}\r
- * \r
- * <dt>Bits Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.BitsTypeDefinition}\r
- * \r
- * <dt>The binary Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.BinaryTypeDefinition}\r
- * \r
- * <dt>The leafref Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.LeafrefTypeDefinition}\r
- * \r
- * <dt>The identityref Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.IdentityrefTypeDefinition}\r
- * \r
- * <dt>The empty Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.EmptyTypeDefinition}\r
- * \r
- * <dt>The union Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.UnionTypeDefinition}\r
- * <dt>The instance-identifier Built-In Type\r
- * <dd>{@link org.opendaylight.controller.model.api.type.InstanceIdentifierTypeDefinition}\r
- * \r
- * </dl>\r
- */\r
-package org.opendaylight.controller.yang.model.api;\r
-\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+/**
+ * Definition of structures and DOM Like API of processed YANG schema
+ *
+ * <h3>YANG Statement mapping</h3>
+ *
+ * <dl>
+ * <dt>anyxml
+ * <dd>{@link org.opendaylight.controller.yang.model.api.AnyXmlSchemaNode}
+ *
+ * <dt>argument
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ExtensionDefinition#getArgumentName()}
+ *
+ *
+ * <dt>augment
+ * <dd>{@link org.opendaylight.controller.yang.model.api.AugmentationSchema}
+ *
+ * <dt>base
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.IdentityrefTypeDefinition#getIdentity()}
+ *
+ * <dt>belongs-to
+ * <dd>
+ *
+ * <dt>bit
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition.Bit}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition#getBits()}
+ *
+ * <dt>case
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ChoiceCaseNode}
+ *
+ * <dt>choice
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ChoiceNode}
+ *
+ * <dt>config
+ * <dd>{@link org.opendaylight.controller.yang.model.api.DataSchemaNode#isConfiguration()}
+ *
+ * <dt>contact
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getContact()}
+ *
+ * <dt>container
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ContainerSchemaNode}
+ *
+ * <dt>default
+ * <dd>
+ *
+ * <dt>description
+ * <dd>{@link org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition#getDescription()}
+ *
+ * <dt>enum
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition#getValues()}
+ *
+ * <dt>error-app-tag
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition#getErrorAppTag()}
+ *
+ * <dt>error-message
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition#getErrorMessage()}
+ *
+ * <dt>extension
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ExtensionDefinition}
+ *
+ * <dt>deviation
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Deviation}
+ *
+ * <dt>deviate
+ * <dd>
+ *
+ * <dt>feature
+ * <dd>{@link org.opendaylight.controller.yang.model.api.FeatureDefinition}
+ *
+ * <dt>fraction-digits
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.DecimalTypeDefinition#getFractionDigits()}
+ *
+ * <dt>grouping
+ * <dd>{@link org.opendaylight.controller.yang.model.api.GroupingDefinition}
+ *
+ * <dt>identity
+ * <dd>
+ *
+ * <dt>if-feature
+ * <dd>
+ *
+ * <dt>import
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ModuleImport}
+ *
+ * <dt>include
+ * <dd>
+ *
+ * <dt>input
+ * <dd>{@link org.opendaylight.controller.yang.model.api.RpcDefinition#getInput()}
+ *
+ * <dt>key
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ListSchemaNode#getKeyDefinition()}
+ *
+ * <dt>leaf
+ * <dd>{@link org.opendaylight.controller.yang.model.api.LeafSchemaNode}
+ *
+ * <dt>leaf-list
+ * <dd>{@link org.opendaylight.controller.yang.model.api.LeafListSchemaNode}
+ *
+ * <dt>length
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.LengthConstraint}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.StringTypeDefinition#getLengthStatements()}
+ *
+ * <dt>list
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ListSchemaNode}
+ *
+ * <dt>mandatory
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#isMandatory()}
+ *
+ * <dt>max-elements
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getMinElements()}
+ *
+ * <dt>min-elements
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getMaxElements()}
+ *
+ * <dt>module
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Module}
+ *
+ * <dt>must
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getMustConstraints()}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.MustDefinition}
+ *
+ * <dt>namespace
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getNamespace()}
+ *
+ * <dt>notification
+ * <dd>{@link org.opendaylight.controller.yang.model.api.NotificationDefinition}
+ *
+ * <dt>ordered-by
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ListSchemaNode#isUserOrdered()}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.LeafListSchemaNode#isUserOrdered()}
+ *
+ * <dt>organization
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getOrganization()}
+ *
+ * <dt>output
+ * <dd>{@link org.opendaylight.controller.yang.model.api.RpcDefinition#getOutput()}
+ *
+ * <dt>path
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.LeafrefTypeDefinition#getPathStatement()}
+ *
+ * <dt>pattern
+ * <dd>{@link org.opendaylight.controller.yang.model.base.type.api.PatternConstraint}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.StringTypeDefinition}
+ *
+ * <dt>position
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition.Bit#getPosition()}
+ *
+ * <dt>prefix
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getPrefix()}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ModuleImport#getPrefix()}
+ *
+ * <dt>presence
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ContainerSchemaNode#isPresenceContainer()}
+ *
+ * <dt>range
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.RangeConstraint}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition#getRangeStatements()}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition#getRangeStatements()}
+ *
+ * <dt>reference
+ * <dd>{@link org.opendaylight.controller.yang.model.api.SchemaNode#getReference()}
+ *
+ * <dt>refine
+ * <dd>
+ *
+ * <dt>require-instance
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#requireInstance()}
+ *
+ * <dt>revision
+ * <dd>{@link org.opendaylight.controller.yang.model.api.Module#getRevision()}
+ *
+ * <dt>revision-date
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ModuleImport#getRevision()}
+ *
+ * <dt>rpc
+ * <dd>{@link org.opendaylight.controller.yang.model.api.RpcDefinition}
+ *
+ * <dt>status
+ * <dd>{@link org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()}
+ *
+ * <dt>submodule
+ * <dd>
+ *
+ * <dt>type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.TypeDefinition}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.LeafSchemaNode#getType()}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.LeafListSchemaNode#getType()}
+ *
+ * <dt>typedef
+ * <dd>{@link org.opendaylight.controller.yang.model.api.TypeDefinition}
+ *
+ * <dt>unique
+ * <dd>
+ *
+ * <dt>units
+ * <dd>{@link org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()}
+ *
+ * <dt>uses
+ * <dd>{@link org.opendaylight.controller.yang.model.api.UsesNode}
+ * <dd>{@link org.opendaylight.controller.yang.model.api.DataNodeContainere#getUses()}
+ *
+ * <dt>value
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair#getValue()}
+ *
+ * <dt>when
+ * <dd>{@link org.opendaylight.controller.yang.model.api.ConstraintDefinition#getWhenCondition()}
+ *
+ * <dt>yang-version
+ *
+ * <dt>yin-element
+ * <dd>
+ *
+ *
+ *
+ *
+ * <dt>add
+ * <dd>
+ *
+ * <dt>current
+ * <dd>
+ *
+ * <dt>delete
+ * <dd>
+ *
+ * <dt>deprecated
+ * <dd>
+ *
+ * <dt>false
+ * <dd>
+ *
+ * <dt>max
+ * <dd>
+ *
+ * <dt>min
+ * <dd>
+ *
+ * <dt>not-supported
+ * <dd>
+ *
+ * <dt>obsolete
+ * <dd>
+ *
+ * <dt>replace
+ * <dd>
+ *
+ * <dt>system
+ * <dd>
+ *
+ * <dt>true
+ * <dd>
+ *
+ * <dt>unbounded
+ * <dd>
+ *
+ * <dt>user
+ * <dd>
+ * </dl>
+ *
+ *
+ * <h3>YANG Base Type Mapping</h3>
+ *
+ *
+ * <dl>
+ * <dt>Integer built-in type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition}
+ *
+ * <dt>Unsigned integer built-in type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition}
+ *
+ * <dt>Decimal64 built-ib type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.DecimalTypeDefinition}
+ *
+ * <dt>Boolean built-in type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.BooleanTypeDefinition}
+ *
+ * <dt>Enumeration built-in type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition}
+ *
+ * <dt>Bits Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition}
+ *
+ * <dt>The binary Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.BinaryTypeDefinition}
+ *
+ * <dt>The leafref Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.LeafrefTypeDefinition}
+ *
+ * <dt>The identityref Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.IdentityrefTypeDefinition}
+ *
+ * <dt>The empty Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.EmptyTypeDefinition}
+ *
+ * <dt>The union Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.UnionTypeDefinition}
+ * <dt>The instance-identifier Built-In Type
+ * <dd>{@link org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition}
+ *
+ * </dl>
+ */
+package org.opendaylight.controller.yang.model.api;
+
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-/**\r
- * The binary built-in type represents any binary data, i.e., a sequence of\r
- * octets. <br>\r
- * <br>\r
- * Binary values are encoded with the base64 encoding scheme (see <a\r
- * href="https://tools.ietf.org/html/rfc4648#section-4">[RFC4648], Section\r
- * 4</a>). <br>\r
- * The canonical form of a binary value follows the rules in <a\r
- * href="https://tools.ietf.org/html/rfc4648">[RFC4648]</a>.\r
- * \r
- * <br>\r
- * <br>\r
- * This interface was modeled according to definition in <a\r
- * href="https://tools.ietf.org/html/rfc6020#section-9.8">[RFC-6020] The binary\r
- * Built-In Type</a>\r
- * \r
- */\r
-public interface BinaryTypeDefinition extends\r
- TypeDefinition<BinaryTypeDefinition> {\r
-\r
- /**\r
- * Returns List of number of octets that binary value contains.\r
- * \r
- * @return List of number of octets that binary value contains.\r
- * \r
- * @see LengthConstraint\r
- */\r
- public List<LengthConstraint> getLengthConstraints();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+/**
+ * The binary built-in type represents any binary data, i.e., a sequence of
+ * octets. <br>
+ * <br>
+ * Binary values are encoded with the base64 encoding scheme (see <a
+ * href="https://tools.ietf.org/html/rfc4648#section-4">[RFC4648], Section
+ * 4</a>). <br>
+ * The canonical form of a binary value follows the rules in <a
+ * href="https://tools.ietf.org/html/rfc4648">[RFC4648]</a>.
+ *
+ * <br>
+ * <br>
+ * This interface was modeled according to definition in <a
+ * href="https://tools.ietf.org/html/rfc6020#section-9.8">[RFC-6020] The binary
+ * Built-In Type</a>
+ *
+ */
+public interface BinaryTypeDefinition extends
+ TypeDefinition<BinaryTypeDefinition> {
+
+ /**
+ * Returns List of number of octets that binary value contains.
+ *
+ * @return List of number of octets that binary value contains.
+ *
+ * @see LengthConstraint
+ */
+ public List<LengthConstraint> getLengthConstraints();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.SchemaNode;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface BitsTypeDefinition extends TypeDefinition<BitsTypeDefinition> {\r
-\r
- public List<Bit> getBits();\r
-\r
- interface Bit extends SchemaNode {\r
- /**\r
- * The position value MUST be in the range 0 to 4294967295, and it MUST\r
- * be unique within the bits type.\r
- * \r
- * @return The position value of bit in range from 0 to 4294967295.\r
- */\r
- public Long getPosition();\r
-\r
- public String getName();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.SchemaNode;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface BitsTypeDefinition extends TypeDefinition<BitsTypeDefinition> {
+
+ public List<Bit> getBits();
+
+ interface Bit extends SchemaNode {
+ /**
+ * The position value MUST be in the range 0 to 4294967295, and it MUST
+ * be unique within the bits type.
+ *
+ * @return The position value of bit in range from 0 to 4294967295.
+ */
+ public Long getPosition();
+
+ public String getName();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface BooleanTypeDefinition extends\r
- TypeDefinition<BooleanTypeDefinition> {\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface BooleanTypeDefinition extends
+ TypeDefinition<BooleanTypeDefinition> {
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface DecimalTypeDefinition extends\r
- TypeDefinition<DecimalTypeDefinition> {\r
-\r
- List<RangeConstraint> getRangeStatements();\r
-\r
- /**\r
- * Returns integer between 1 and 18 inclusively. <br>\r
- * <br>\r
- * \r
- * The "fraction-digits" statement controls the size of the minimum\r
- * difference between values of a decimal64 type, by restricting the value\r
- * space to numbers that are expressible as "i x 10^-n" where n is the\r
- * fraction-digits argument.\r
- * \r
- * @return\r
- */\r
- Integer getFractionDigits();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface DecimalTypeDefinition extends
+ TypeDefinition<DecimalTypeDefinition> {
+
+ List<RangeConstraint> getRangeStatements();
+
+ /**
+ * Returns integer between 1 and 18 inclusively. <br>
+ * <br>
+ *
+ * The "fraction-digits" statement controls the size of the minimum
+ * difference between values of a decimal64 type, by restricting the value
+ * space to numbers that are expressible as "i x 10^-n" where n is the
+ * fraction-digits argument.
+ *
+ * @return
+ */
+ Integer getFractionDigits();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface EmptyTypeDefinition extends\r
- TypeDefinition<EmptyTypeDefinition> {\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface EmptyTypeDefinition extends
+ TypeDefinition<EmptyTypeDefinition> {
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.SchemaNode;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {\r
-\r
- List<EnumPair> getValues();\r
-\r
- interface EnumPair extends SchemaNode {\r
-\r
- /**\r
- * The name to specify each assigned name of an enumeration type.\r
- * \r
- * @return name of each assigned name of an enumeration type.\r
- */\r
- public String getName();\r
-\r
- /**\r
- * The "value" statement, which is optional, is used to associate an\r
- * integer value with the assigned name for the enum. This integer value\r
- * MUST be in the range -2147483648 to 2147483647, and it MUST be unique\r
- * within the enumeration type.\r
- * \r
- * @return integer value assigned to enumeration\r
- */\r
- public Integer getValue();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.SchemaNode;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
+
+ List<EnumPair> getValues();
+
+ interface EnumPair extends SchemaNode {
+
+ /**
+ * The name to specify each assigned name of an enumeration type.
+ *
+ * @return name of each assigned name of an enumeration type.
+ */
+ public String getName();
+
+ /**
+ * The "value" statement, which is optional, is used to associate an
+ * integer value with the assigned name for the enum. This integer value
+ * MUST be in the range -2147483648 to 2147483647, and it MUST be unique
+ * within the enumeration type.
+ *
+ * @return integer value assigned to enumeration
+ */
+ public Integer getValue();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface IdentityTypeDefinition extends\r
- TypeDefinition<IdentityTypeDefinition> {\r
-\r
- public QName getIdentityName();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface IdentityTypeDefinition extends
+ TypeDefinition<IdentityTypeDefinition> {
+
+ public QName getIdentityName();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface IdentityrefTypeDefinition extends\r
- TypeDefinition<IdentityTypeDefinition> {\r
- \r
- public RevisionAwareXPath getPathStatement();\r
- \r
- public IdentityTypeDefinition getIdentity();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface IdentityrefTypeDefinition extends
+ TypeDefinition<IdentityTypeDefinition> {
+
+ public RevisionAwareXPath getPathStatement();
+
+ public IdentityTypeDefinition getIdentity();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface InstanceIdentifierTypeDefinition extends\r
- TypeDefinition<InstanceIdentifierTypeDefinition> {\r
-\r
- public RevisionAwareXPath getPathStatement();\r
-\r
- public boolean requireInstance();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface InstanceIdentifierTypeDefinition extends
+ TypeDefinition<InstanceIdentifierTypeDefinition> {
+
+ public RevisionAwareXPath getPathStatement();
+
+ public boolean requireInstance();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-/**\r
- * IntegerTypeDefinition is interface which represents SIGNED Integer values\r
- * defined in Yang language. <br>\r
- * The integer built-in types in Yang are int8, int16, int32, int64. They\r
- * represent signed integers of different sizes: <br>\r
- * <ul>\r
- * <li>int8 represents integer values between -128 and 127, inclusively.</li>\r
- * <li>int16 represents integer values between -32768 and 32767, inclusively.</li>\r
- * <li>int32 represents integer values between -2147483648 and 2147483647,\r
- * inclusively.</li>\r
- * <li>int64 represents integer values between -9223372036854775808 and\r
- * 9223372036854775807, inclusively.</li>\r
- * </ul>\r
- * \r
- * The Integer Built-In Types are defined in <a\r
- * href="https://tools.ietf.org/html/rfc6020#section-9.2"> [RFC-6020]</a>\r
- */\r
-public interface IntegerTypeDefinition extends\r
- TypeDefinition<IntegerTypeDefinition> {\r
-\r
- /**\r
- * Returns Range Constraints defined for given Integer Type.\r
- * \r
- * @return Range Constraints defined for given Integer Type.\r
- */\r
- List<RangeConstraint> getRangeStatements();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+/**
+ * IntegerTypeDefinition is interface which represents SIGNED Integer values
+ * defined in Yang language. <br>
+ * The integer built-in types in Yang are int8, int16, int32, int64. They
+ * represent signed integers of different sizes: <br>
+ * <ul>
+ * <li>int8 represents integer values between -128 and 127, inclusively.</li>
+ * <li>int16 represents integer values between -32768 and 32767, inclusively.</li>
+ * <li>int32 represents integer values between -2147483648 and 2147483647,
+ * inclusively.</li>
+ * <li>int64 represents integer values between -9223372036854775808 and
+ * 9223372036854775807, inclusively.</li>
+ * </ul>
+ *
+ * The Integer Built-In Types are defined in <a
+ * href="https://tools.ietf.org/html/rfc6020#section-9.2"> [RFC-6020]</a>
+ */
+public interface IntegerTypeDefinition extends
+ TypeDefinition<IntegerTypeDefinition> {
+
+ /**
+ * Returns Range Constraints defined for given Integer Type.
+ *
+ * @return Range Constraints defined for given Integer Type.
+ */
+ List<RangeConstraint> getRangeStatements();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface LeafrefTypeDefinition extends\r
- TypeDefinition<LeafrefTypeDefinition> {\r
-\r
- public RevisionAwareXPath getPathStatement();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface LeafrefTypeDefinition extends
+ TypeDefinition<LeafrefTypeDefinition> {
+
+ public RevisionAwareXPath getPathStatement();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;\r
-\r
-/**\r
- * The Lenght Constraint value consists of an explicit value, or a lower bound\r
- * returned by {@link #getMin()} and an upper bound returned by\r
- * {@link #getMax()}. <br>\r
- * <br>\r
- * Length-restricting values MUST NOT be negative. A length value is a\r
- * non-negative integer, or one of the special values <code>min</code> or\r
- * <code>max</code>. The defined <code>min</code> and <code>max</code> mean the\r
- * minimum and maximum length accepted for the type being restricted,\r
- * respectively. <br>\r
- * An implementation is not required to support a length value larger than\r
- * {@link Long#MAX_VALUE} <br>\r
- * <br>\r
- * The interface extends definitions from {@link ConstraintMetaDefinition} <br>\r
- * <br>\r
- * This interface was modeled according to definition in <a\r
- * href="https://tools.ietf.org/html/rfc6020#section-9.4.4">[RFC-6020] The\r
- * length Statement</a>.\r
- * \r
- * @see ConstraintMetaDefinition\r
- */\r
-public interface LengthConstraint extends ConstraintMetaDefinition {\r
-\r
- /**\r
- * Returns the length-restricting lower bound value. <br>\r
- * The value MUST NOT be negative.\r
- * \r
- * @return the length-restricting lower bound value.\r
- */\r
- Long getMin();\r
-\r
- /**\r
- * Returns the length-restricting upper bound value. <br>\r
- * The value MUST NOT be negative.\r
- * \r
- * @return length-restricting upper bound value.\r
- */\r
- Long getMax();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;
+
+/**
+ * The Lenght Constraint value consists of an explicit value, or a lower bound
+ * returned by {@link #getMin()} and an upper bound returned by
+ * {@link #getMax()}. <br>
+ * <br>
+ * Length-restricting values MUST NOT be negative. A length value is a
+ * non-negative integer, or one of the special values <code>min</code> or
+ * <code>max</code>. The defined <code>min</code> and <code>max</code> mean the
+ * minimum and maximum length accepted for the type being restricted,
+ * respectively. <br>
+ * An implementation is not required to support a length value larger than
+ * {@link Long#MAX_VALUE} <br>
+ * <br>
+ * The interface extends definitions from {@link ConstraintMetaDefinition} <br>
+ * <br>
+ * This interface was modeled according to definition in <a
+ * href="https://tools.ietf.org/html/rfc6020#section-9.4.4">[RFC-6020] The
+ * length Statement</a>.
+ *
+ * @see ConstraintMetaDefinition
+ */
+public interface LengthConstraint extends ConstraintMetaDefinition {
+
+ /**
+ * Returns the length-restricting lower bound value. <br>
+ * The value MUST NOT be negative.
+ *
+ * @return the length-restricting lower bound value.
+ */
+ Long getMin();
+
+ /**
+ * Returns the length-restricting upper bound value. <br>
+ * The value MUST NOT be negative.
+ *
+ * @return length-restricting upper bound value.
+ */
+ Long getMax();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;\r
-\r
-public interface PatternConstraint extends ConstraintMetaDefinition {\r
-\r
- public String getRegularExpression();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;
+
+public interface PatternConstraint extends ConstraintMetaDefinition {
+
+ public String getRegularExpression();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;\r
-\r
-/**\r
- * The Range Constraint interface is used to restrict integer and decimal\r
- * built-in types, or types derived from those.\r
- * <br>\r
- * A range consists of an explicit value consists of an explicit value, or a lower bound\r
- * returned by {@link #getMin()} and an upper bound returned by\r
- * {@link #getMax()}. <br>\r
- * <br>\r
- * Each explicit value and range boundary value given in\r
- * the range expression MUST match the type being restricted, or be one of the\r
- * special values "min" or "max". "min" and "max" mean the minimum and maximum\r
- * value accepted for the type being restricted, respectively\r
- * <br>\r
- * <br>\r
- * This interface was modeled according to definition in <a\r
- * href="https://tools.ietf.org/html/rfc6020#section-9.2.4">[RFC-6020] The\r
- * range Statement</a>.\r
- */\r
-public interface RangeConstraint extends ConstraintMetaDefinition {\r
-\r
- /**\r
- * Returns the length-restricting lower bound value.\r
- * \r
- * @return the length-restricting lower bound value.\r
- */\r
- Number getMin();\r
-\r
- /**\r
- * Returns the length-restricting upper bound value.\r
- * \r
- * @return the length-restricting upper bound value.\r
- */\r
- Number getMax();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;
+
+/**
+ * The Range Constraint interface is used to restrict integer and decimal
+ * built-in types, or types derived from those.
+ * <br>
+ * A range consists of an explicit value consists of an explicit value, or a lower bound
+ * returned by {@link #getMin()} and an upper bound returned by
+ * {@link #getMax()}. <br>
+ * <br>
+ * Each explicit value and range boundary value given in
+ * the range expression MUST match the type being restricted, or be one of the
+ * special values "min" or "max". "min" and "max" mean the minimum and maximum
+ * value accepted for the type being restricted, respectively
+ * <br>
+ * <br>
+ * This interface was modeled according to definition in <a
+ * href="https://tools.ietf.org/html/rfc6020#section-9.2.4">[RFC-6020] The
+ * range Statement</a>.
+ */
+public interface RangeConstraint extends ConstraintMetaDefinition {
+
+ /**
+ * Returns the length-restricting lower bound value.
+ *
+ * @return the length-restricting lower bound value.
+ */
+ Number getMin();
+
+ /**
+ * Returns the length-restricting upper bound value.
+ *
+ * @return the length-restricting upper bound value.
+ */
+ Number getMax();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface StringTypeDefinition extends\r
- TypeDefinition<StringTypeDefinition> {\r
-\r
- List<LengthConstraint> getLengthStatements();\r
-\r
- List<PatternConstraint> getPatterns();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface StringTypeDefinition extends
+ TypeDefinition<StringTypeDefinition> {
+
+ List<LengthConstraint> getLengthStatements();
+
+ List<PatternConstraint> getPatterns();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface UnionTypeDefinition extends\r
- TypeDefinition<UnionTypeDefinition> {\r
-\r
- public List<TypeDefinition<?>> getTypes();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface UnionTypeDefinition extends
+ TypeDefinition<UnionTypeDefinition> {
+
+ public List<TypeDefinition<?>> getTypes();
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface UnknownTypeDefinition extends\r
- TypeDefinition<UnknownTypeDefinition> {\r
-\r
- List<RangeConstraint> getRangeStatements();\r
-\r
- List<LengthConstraint> getLengthStatements();\r
-\r
- List<PatternConstraint> getPatterns();\r
-\r
- LengthConstraint getLengthConstraint();\r
-\r
- Integer getFractionDigits();\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface UnknownTypeDefinition extends
+ TypeDefinition<UnknownTypeDefinition> {
+
+ List<RangeConstraint> getRangeStatements();
+
+ List<LengthConstraint> getLengthStatements();
+
+ List<PatternConstraint> getPatterns();
+
+ LengthConstraint getLengthConstraint();
+
+ Integer getFractionDigits();
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.api.type;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public interface UnsignedIntegerTypeDefinition extends\r
- TypeDefinition<UnsignedIntegerTypeDefinition> {\r
-\r
- List<RangeConstraint> getRangeStatements();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.api.type;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+
+public interface UnsignedIntegerTypeDefinition extends
+ TypeDefinition<UnsignedIntegerTypeDefinition> {
+
+ List<RangeConstraint> getRangeStatements();
+}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.model.util;
+package org.opendaylight.controller.yang.model.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;
-import org.opendaylight.controller.model.api.type.RangeConstraint;
import org.opendaylight.controller.yang.common.QName;
import org.opendaylight.controller.yang.model.api.SchemaPath;
import org.opendaylight.controller.yang.model.api.Status;
import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
/**
* The Abstract Integer class defines implementation of IntegerTypeDefinition
/**
*
*/
-package org.opendaylight.controller.model.util;
+package org.opendaylight.controller.yang.model.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.opendaylight.controller.model.api.type.RangeConstraint;
-import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;
import org.opendaylight.controller.yang.common.QName;
import org.opendaylight.controller.yang.model.api.SchemaPath;
import org.opendaylight.controller.yang.model.api.Status;
import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
/**
* The Abstract Integer class defines implementation of IntegerTypeDefinition
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import org.opendaylight.controller.model.api.type.LengthConstraint;\r
-import org.opendaylight.controller.model.api.type.PatternConstraint;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-\r
-public final class BaseConstraints {\r
-\r
- private BaseConstraints() {\r
- }\r
-\r
- public static LengthConstraint lengthConstraint(final long min,\r
- final long max, final String description, final String reference) {\r
- return new LengthConstraintImpl(min, max, description, reference);\r
- }\r
-\r
- public static RangeConstraint rangeConstraint(final Number min,\r
- final Number max, final String description, final String reference) {\r
- return new RangeConstraintImpl(min, max, description, reference);\r
- }\r
-\r
- public static PatternConstraint patternConstraint(final String pattern,\r
- final String description, final String reference) {\r
- return new PatternConstraintImpl(pattern, description, reference);\r
- }\r
-\r
- private static final class LengthConstraintImpl implements LengthConstraint {\r
-\r
- private final long min;\r
- private final long max;\r
-\r
- private final String description;\r
- private final String reference;\r
-\r
- private final String errorAppTag;\r
- private final String errorMessage;\r
-\r
- public LengthConstraintImpl(long min, long max,\r
- final String description, final String reference) {\r
- super();\r
- this.min = min;\r
- this.max = max;\r
- this.description = description;\r
- this.reference = reference;\r
-\r
- this.errorAppTag = "length-out-of-specified-bounds";\r
- this.errorMessage = "The argument is out of bounds <" + min + ", "\r
- + max + ">";\r
- }\r
-\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- @Override\r
- public String getErrorAppTag() {\r
- return errorAppTag;\r
- }\r
-\r
- @Override\r
- public String getErrorMessage() {\r
- return errorMessage;\r
- }\r
-\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- @Override\r
- public Long getMin() {\r
- return min;\r
- }\r
-\r
- @Override\r
- public Long getMax() {\r
- return max;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result\r
- + ((errorAppTag == null) ? 0 : errorAppTag.hashCode());\r
- result = prime * result\r
- + ((errorMessage == null) ? 0 : errorMessage.hashCode());\r
- result = prime * result + (int) (max ^ (max >>> 32));\r
- result = prime * result + (int) (min ^ (min >>> 32));\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(final Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- final LengthConstraintImpl other = (LengthConstraintImpl) obj;\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (errorAppTag == null) {\r
- if (other.errorAppTag != null) {\r
- return false;\r
- }\r
- } else if (!errorAppTag.equals(other.errorAppTag)) {\r
- return false;\r
- }\r
- if (errorMessage == null) {\r
- if (other.errorMessage != null) {\r
- return false;\r
- }\r
- } else if (!errorMessage.equals(other.errorMessage)) {\r
- return false;\r
- }\r
- if (max != other.max) {\r
- return false;\r
- }\r
- if (min != other.min) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("LengthConstraintImpl [min=");\r
- builder.append(min);\r
- builder.append(", max=");\r
- builder.append(max);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", errorAppTag=");\r
- builder.append(errorAppTag);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", errorMessage=");\r
- builder.append(errorMessage);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
- }\r
-\r
- private final static class RangeConstraintImpl implements RangeConstraint {\r
- private final Number min;\r
- private final Number max;\r
-\r
- private final String description;\r
- private final String reference;\r
-\r
- private final String errorAppTag;\r
- private final String errorMessage;\r
-\r
- public RangeConstraintImpl(Number min, Number max, String description,\r
- String reference) {\r
- super();\r
- this.min = min;\r
- this.max = max;\r
- this.description = description;\r
- this.reference = reference;\r
-\r
- this.errorAppTag = "range-out-of-specified-bounds";\r
- this.errorMessage = "The argument is out of bounds <" + min + ", "\r
- + max + ">";\r
- }\r
-\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- @Override\r
- public String getErrorAppTag() {\r
- return errorAppTag;\r
- }\r
-\r
- @Override\r
- public String getErrorMessage() {\r
- return errorMessage;\r
- }\r
-\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- @Override\r
- public Number getMin() {\r
- return min;\r
- }\r
-\r
- @Override\r
- public Number getMax() {\r
- return max;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result\r
- + ((errorAppTag == null) ? 0 : errorAppTag.hashCode());\r
- result = prime * result\r
- + ((errorMessage == null) ? 0 : errorMessage.hashCode());\r
- result = prime * result + ((max == null) ? 0 : max.hashCode());\r
- result = prime * result + ((min == null) ? 0 : min.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(final Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- final RangeConstraintImpl other = (RangeConstraintImpl) obj;\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (errorAppTag == null) {\r
- if (other.errorAppTag != null) {\r
- return false;\r
- }\r
- } else if (!errorAppTag.equals(other.errorAppTag)) {\r
- return false;\r
- }\r
- if (errorMessage == null) {\r
- if (other.errorMessage != null) {\r
- return false;\r
- }\r
- } else if (!errorMessage.equals(other.errorMessage)) {\r
- return false;\r
- }\r
- if (max == null) {\r
- if (other.max != null) {\r
- return false;\r
- }\r
- } else if (!max.equals(other.max)) {\r
- return false;\r
- }\r
- if (min == null) {\r
- if (other.min != null) {\r
- return false;\r
- }\r
- } else if (!min.equals(other.min)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- final StringBuilder builder = new StringBuilder();\r
- builder.append("RangeConstraintImpl [min=");\r
- builder.append(min);\r
- builder.append(", max=");\r
- builder.append(max);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", errorAppTag=");\r
- builder.append(errorAppTag);\r
- builder.append(", errorMessage=");\r
- builder.append(errorMessage);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
- }\r
-\r
- private final static class PatternConstraintImpl implements\r
- PatternConstraint {\r
-\r
- private final String regex;\r
- private final String description;\r
- private final String reference;\r
-\r
- private final String errorAppTag;\r
- private final String errorMessage;\r
-\r
- public PatternConstraintImpl(final String regex,\r
- final String description, final String reference) {\r
- super();\r
- this.regex = regex;\r
- this.description = description;\r
- this.reference = reference;\r
-\r
- errorAppTag = "invalid-regular-expression";\r
- // TODO: add erro message\r
- errorMessage = "";\r
- }\r
-\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- @Override\r
- public String getErrorAppTag() {\r
- return errorAppTag;\r
- }\r
-\r
- @Override\r
- public String getErrorMessage() {\r
- return errorMessage;\r
- }\r
-\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- @Override\r
- public String getRegularExpression() {\r
- return regex;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result\r
- + ((errorAppTag == null) ? 0 : errorAppTag.hashCode());\r
- result = prime * result\r
- + ((errorMessage == null) ? 0 : errorMessage.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((regex == null) ? 0 : regex.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(final Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- final PatternConstraintImpl other = (PatternConstraintImpl) obj;\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (errorAppTag == null) {\r
- if (other.errorAppTag != null) {\r
- return false;\r
- }\r
- } else if (!errorAppTag.equals(other.errorAppTag)) {\r
- return false;\r
- }\r
- if (errorMessage == null) {\r
- if (other.errorMessage != null) {\r
- return false;\r
- }\r
- } else if (!errorMessage.equals(other.errorMessage)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (regex == null) {\r
- if (other.regex != null) {\r
- return false;\r
- }\r
- } else if (!regex.equals(other.regex)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("PatternConstraintImpl [regex=");\r
- builder.append(regex);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", errorAppTag=");\r
- builder.append(errorAppTag);\r
- builder.append(", errorMessage=");\r
- builder.append(errorMessage);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import org.opendaylight.controller.yang.model.api.type.LengthConstraint;
+import org.opendaylight.controller.yang.model.api.type.PatternConstraint;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+
+public final class BaseConstraints {
+
+ private BaseConstraints() {
+ }
+
+ public static LengthConstraint lengthConstraint(final long min,
+ final long max, final String description, final String reference) {
+ return new LengthConstraintImpl(min, max, description, reference);
+ }
+
+ public static RangeConstraint rangeConstraint(final Number min,
+ final Number max, final String description, final String reference) {
+ return new RangeConstraintImpl(min, max, description, reference);
+ }
+
+ public static PatternConstraint patternConstraint(final String pattern,
+ final String description, final String reference) {
+ return new PatternConstraintImpl(pattern, description, reference);
+ }
+
+ private static final class LengthConstraintImpl implements LengthConstraint {
+
+ private final long min;
+ private final long max;
+
+ private final String description;
+ private final String reference;
+
+ private final String errorAppTag;
+ private final String errorMessage;
+
+ public LengthConstraintImpl(long min, long max,
+ final String description, final String reference) {
+ super();
+ this.min = min;
+ this.max = max;
+ this.description = description;
+ this.reference = reference;
+
+ this.errorAppTag = "length-out-of-specified-bounds";
+ this.errorMessage = "The argument is out of bounds <" + min + ", "
+ + max + ">";
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getErrorAppTag() {
+ return errorAppTag;
+ }
+
+ @Override
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ @Override
+ public Long getMin() {
+ return min;
+ }
+
+ @Override
+ public Long getMax() {
+ return max;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result
+ + ((errorAppTag == null) ? 0 : errorAppTag.hashCode());
+ result = prime * result
+ + ((errorMessage == null) ? 0 : errorMessage.hashCode());
+ result = prime * result + (int) (max ^ (max >>> 32));
+ result = prime * result + (int) (min ^ (min >>> 32));
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final LengthConstraintImpl other = (LengthConstraintImpl) obj;
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (errorAppTag == null) {
+ if (other.errorAppTag != null) {
+ return false;
+ }
+ } else if (!errorAppTag.equals(other.errorAppTag)) {
+ return false;
+ }
+ if (errorMessage == null) {
+ if (other.errorMessage != null) {
+ return false;
+ }
+ } else if (!errorMessage.equals(other.errorMessage)) {
+ return false;
+ }
+ if (max != other.max) {
+ return false;
+ }
+ if (min != other.min) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("LengthConstraintImpl [min=");
+ builder.append(min);
+ builder.append(", max=");
+ builder.append(max);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", errorAppTag=");
+ builder.append(errorAppTag);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", errorMessage=");
+ builder.append(errorMessage);
+ builder.append("]");
+ return builder.toString();
+ }
+ }
+
+ private final static class RangeConstraintImpl implements RangeConstraint {
+ private final Number min;
+ private final Number max;
+
+ private final String description;
+ private final String reference;
+
+ private final String errorAppTag;
+ private final String errorMessage;
+
+ public RangeConstraintImpl(Number min, Number max, String description,
+ String reference) {
+ super();
+ this.min = min;
+ this.max = max;
+ this.description = description;
+ this.reference = reference;
+
+ this.errorAppTag = "range-out-of-specified-bounds";
+ this.errorMessage = "The argument is out of bounds <" + min + ", "
+ + max + ">";
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getErrorAppTag() {
+ return errorAppTag;
+ }
+
+ @Override
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ @Override
+ public Number getMin() {
+ return min;
+ }
+
+ @Override
+ public Number getMax() {
+ return max;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result
+ + ((errorAppTag == null) ? 0 : errorAppTag.hashCode());
+ result = prime * result
+ + ((errorMessage == null) ? 0 : errorMessage.hashCode());
+ result = prime * result + ((max == null) ? 0 : max.hashCode());
+ result = prime * result + ((min == null) ? 0 : min.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final RangeConstraintImpl other = (RangeConstraintImpl) obj;
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (errorAppTag == null) {
+ if (other.errorAppTag != null) {
+ return false;
+ }
+ } else if (!errorAppTag.equals(other.errorAppTag)) {
+ return false;
+ }
+ if (errorMessage == null) {
+ if (other.errorMessage != null) {
+ return false;
+ }
+ } else if (!errorMessage.equals(other.errorMessage)) {
+ return false;
+ }
+ if (max == null) {
+ if (other.max != null) {
+ return false;
+ }
+ } else if (!max.equals(other.max)) {
+ return false;
+ }
+ if (min == null) {
+ if (other.min != null) {
+ return false;
+ }
+ } else if (!min.equals(other.min)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("RangeConstraintImpl [min=");
+ builder.append(min);
+ builder.append(", max=");
+ builder.append(max);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", errorAppTag=");
+ builder.append(errorAppTag);
+ builder.append(", errorMessage=");
+ builder.append(errorMessage);
+ builder.append("]");
+ return builder.toString();
+ }
+ }
+
+ private final static class PatternConstraintImpl implements
+ PatternConstraint {
+
+ private final String regex;
+ private final String description;
+ private final String reference;
+
+ private final String errorAppTag;
+ private final String errorMessage;
+
+ public PatternConstraintImpl(final String regex,
+ final String description, final String reference) {
+ super();
+ this.regex = regex;
+ this.description = description;
+ this.reference = reference;
+
+ errorAppTag = "invalid-regular-expression";
+ // TODO: add erro message
+ errorMessage = "";
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getErrorAppTag() {
+ return errorAppTag;
+ }
+
+ @Override
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ @Override
+ public String getRegularExpression() {
+ return regex;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result
+ + ((errorAppTag == null) ? 0 : errorAppTag.hashCode());
+ result = prime * result
+ + ((errorMessage == null) ? 0 : errorMessage.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((regex == null) ? 0 : regex.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final PatternConstraintImpl other = (PatternConstraintImpl) obj;
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (errorAppTag == null) {
+ if (other.errorAppTag != null) {
+ return false;
+ }
+ } else if (!errorAppTag.equals(other.errorAppTag)) {
+ return false;
+ }
+ if (errorMessage == null) {
+ if (other.errorMessage != null) {
+ return false;
+ }
+ } else if (!errorMessage.equals(other.errorMessage)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (regex == null) {
+ if (other.regex != null) {
+ return false;
+ }
+ } else if (!regex.equals(other.regex)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("PatternConstraintImpl [regex=");
+ builder.append(regex);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", errorAppTag=");
+ builder.append(errorAppTag);
+ builder.append(", errorMessage=");
+ builder.append(errorMessage);
+ builder.append("]");
+ return builder.toString();
+ }
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.net.URI;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-\r
-public final class BaseTypes {\r
-\r
- private BaseTypes() {}\r
-\r
- public static final URI BaseTypesNamespace = URI\r
- .create("urn:ietf:params:xml:ns:yang:1");\r
-\r
- /**\r
- * Construct QName for Built-in base Yang type. The namespace for\r
- * built-in base yang types is defined as: urn:ietf:params:xml:ns:yang:1\r
- * \r
- * @param typeName yang type name\r
- * @return built-in base yang type QName.\r
- */\r
- public static final QName constructQName(final String typeName) {\r
- return new QName(BaseTypesNamespace, typeName);\r
- }\r
-\r
- /**\r
- * Creates Schema Path from Qname.\r
- * \r
- * @param typeName yang type QName\r
- * @return Schema Path from Qname.\r
- */\r
- public static final SchemaPath schemaPath(final QName typeName) {\r
- final List<QName> pathList = new ArrayList<QName>();\r
- pathList.add(typeName);\r
- return new SchemaPath(pathList, true);\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+
+public final class BaseTypes {
+
+ private BaseTypes() {}
+
+ public static final URI BaseTypesNamespace = URI
+ .create("urn:ietf:params:xml:ns:yang:1");
+
+ /**
+ * Construct QName for Built-in base Yang type. The namespace for
+ * built-in base yang types is defined as: urn:ietf:params:xml:ns:yang:1
+ *
+ * @param typeName yang type name
+ * @return built-in base yang type QName.
+ */
+ public static final QName constructQName(final String typeName) {
+ return new QName(BaseTypesNamespace, typeName);
+ }
+
+ /**
+ * Creates Schema Path from Qname.
+ *
+ * @param typeName yang type QName
+ * @return Schema Path from Qname.
+ */
+ public static final SchemaPath schemaPath(final QName typeName) {
+ final List<QName> pathList = new ArrayList<QName>();
+ pathList.add(typeName);
+ return new SchemaPath(pathList, true);
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.BinaryTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.LengthConstraint;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Binary Type Definition interface.\r
- * \r
- * @see BinaryTypeDefinition\r
- */\r
-public class BinaryType implements BinaryTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("binary");\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final String description = "The binary built-in type represents any binary data, i.e., a sequence of octets.";\r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.8";\r
-\r
- private List<Byte> bytes;\r
- private final List<LengthConstraint> lengthConstraints;\r
- private String units = "";\r
-\r
- /**\r
- * \r
- */\r
- public BinaryType() {\r
- super();\r
- \r
- final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();\r
- constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));\r
- lengthConstraints = Collections.unmodifiableList(constraints);\r
- bytes = Collections.emptyList();\r
- }\r
-\r
- /**\r
- * \r
- * \r
- * @param bytes\r
- * @param lengthConstraints\r
- * @param units\r
- */\r
- public BinaryType(final List<Byte> bytes,\r
- final List<LengthConstraint> lengthConstraints, final String units) {\r
- super();\r
- \r
- if ((lengthConstraints == null) || (lengthConstraints.isEmpty())) {\r
- final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();\r
- constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));\r
- this.lengthConstraints = Collections.unmodifiableList(constraints);\r
- } else {\r
- this.lengthConstraints = Collections.unmodifiableList(lengthConstraints);\r
- }\r
- \r
- this.bytes = Collections.unmodifiableList(bytes);\r
- this.units = units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public BinaryTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return bytes;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.base.type.api.BinaryTypeDefinition#getLengthConstraint\r
- * ()\r
- */\r
- @Override\r
- public List<LengthConstraint> getLengthConstraints() {\r
- return lengthConstraints;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result + ((bytes == null) ? 0 : bytes.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime\r
- * result\r
- + ((lengthConstraints == null) ? 0 : lengthConstraints.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- BinaryType other = (BinaryType) obj;\r
- if (bytes == null) {\r
- if (other.bytes != null) {\r
- return false;\r
- }\r
- } else if (!bytes.equals(other.bytes)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (lengthConstraints == null) {\r
- if (other.lengthConstraints != null) {\r
- return false;\r
- }\r
- } else if (!lengthConstraints.equals(other.lengthConstraints)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("BinaryType [name=");\r
- builder.append(name);\r
- builder.append(", path=");\r
- builder.append(path);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", bytes=");\r
- builder.append(bytes);\r
- builder.append(", lengthConstraints=");\r
- builder.append(lengthConstraints);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.BinaryTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.LengthConstraint;
+
+/**
+ * The <code>default</code> implementation of Binary Type Definition interface.
+ *
+ * @see BinaryTypeDefinition
+ */
+public class BinaryType implements BinaryTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("binary");
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final String description = "The binary built-in type represents any binary data, i.e., a sequence of octets.";
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.8";
+
+ private List<Byte> bytes;
+ private final List<LengthConstraint> lengthConstraints;
+ private String units = "";
+
+ /**
+ *
+ */
+ public BinaryType() {
+ super();
+
+ final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();
+ constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
+ lengthConstraints = Collections.unmodifiableList(constraints);
+ bytes = Collections.emptyList();
+ }
+
+ /**
+ *
+ *
+ * @param bytes
+ * @param lengthConstraints
+ * @param units
+ */
+ public BinaryType(final List<Byte> bytes,
+ final List<LengthConstraint> lengthConstraints, final String units) {
+ super();
+
+ if ((lengthConstraints == null) || (lengthConstraints.isEmpty())) {
+ final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();
+ constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
+ this.lengthConstraints = Collections.unmodifiableList(constraints);
+ } else {
+ this.lengthConstraints = Collections.unmodifiableList(lengthConstraints);
+ }
+
+ this.bytes = Collections.unmodifiableList(bytes);
+ this.units = units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public BinaryTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return bytes;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.base.type.api.BinaryTypeDefinition#getLengthConstraint
+ * ()
+ */
+ @Override
+ public List<LengthConstraint> getLengthConstraints() {
+ return lengthConstraints;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((bytes == null) ? 0 : bytes.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime
+ * result
+ + ((lengthConstraints == null) ? 0 : lengthConstraints.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ BinaryType other = (BinaryType) obj;
+ if (bytes == null) {
+ if (other.bytes != null) {
+ return false;
+ }
+ } else if (!bytes.equals(other.bytes)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (lengthConstraints == null) {
+ if (other.lengthConstraints != null) {
+ return false;
+ }
+ } else if (!lengthConstraints.equals(other.lengthConstraints)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BinaryType [name=");
+ builder.append(name);
+ builder.append(", path=");
+ builder.append(path);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", bytes=");
+ builder.append(bytes);
+ builder.append(", lengthConstraints=");
+ builder.append(lengthConstraints);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.BitsTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-\r
-/**\r
- * The <code>default</code> implementation of Bits Type Definition interface.\r
- * \r
- * @see BitsTypeDefinition\r
- */\r
-public class BitsType implements BitsTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("bits");\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final String description = "The bits built-in type represents a bit set. " +\r
- "That is, a bits value is a set of flags identified by small integer position " +\r
- "numbers starting at 0. Each bit number has an assigned name.";\r
- \r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.7";\r
-\r
- private final List<Bit> bits;\r
- private String units = "";\r
-\r
- /**\r
- * Default constructor. <br>\r
- * Instantiates Bits type as empty bits list.\r
- */\r
- public BitsType() {\r
- super();\r
- bits = Collections.emptyList();\r
- }\r
-\r
- /**\r
- * Constructor with explicit definition of bits assigned to\r
- * BitsType.\r
- * \r
- * @param bits\r
- * The bits assigned for Bits Type\r
- */\r
- public BitsType(final List<Bit> bits) {\r
- super();\r
- this.bits = Collections.unmodifiableList(bits);\r
- this.units = "";\r
- }\r
-\r
- /**\r
- * Constructor with explicit definition of bits assigned to\r
- * BitsType and Units.\r
- * <br>\r
- * The default value of Bits Type is List of bits.\r
- * \r
- * @param bits The bits assigned for Bits Type\r
- * @param units units for bits type\r
- */\r
- public BitsType(List<Bit> bits, String units) {\r
- super();\r
- this.bits = Collections.unmodifiableList(bits);\r
- this.units = units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public BitsTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return bits;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- @Override\r
- public List<Bit> getBits() {\r
- return bits;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result + ((bits == null) ? 0 : bits.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- BitsType other = (BitsType) obj;\r
- if (bits == null) {\r
- if (other.bits != null) {\r
- return false;\r
- }\r
- } else if (!bits.equals(other.bits)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("BitsType [name=");\r
- builder.append(name);\r
- builder.append(", path=");\r
- builder.append(path);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", bits=");\r
- builder.append(bits);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition;
+
+
+/**
+ * The <code>default</code> implementation of Bits Type Definition interface.
+ *
+ * @see BitsTypeDefinition
+ */
+public class BitsType implements BitsTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("bits");
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final String description = "The bits built-in type represents a bit set. " +
+ "That is, a bits value is a set of flags identified by small integer position " +
+ "numbers starting at 0. Each bit number has an assigned name.";
+
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.7";
+
+ private final List<Bit> bits;
+ private String units = "";
+
+ /**
+ * Default constructor. <br>
+ * Instantiates Bits type as empty bits list.
+ */
+ public BitsType() {
+ super();
+ bits = Collections.emptyList();
+ }
+
+ /**
+ * Constructor with explicit definition of bits assigned to
+ * BitsType.
+ *
+ * @param bits
+ * The bits assigned for Bits Type
+ */
+ public BitsType(final List<Bit> bits) {
+ super();
+ this.bits = Collections.unmodifiableList(bits);
+ this.units = "";
+ }
+
+ /**
+ * Constructor with explicit definition of bits assigned to
+ * BitsType and Units.
+ * <br>
+ * The default value of Bits Type is List of bits.
+ *
+ * @param bits The bits assigned for Bits Type
+ * @param units units for bits type
+ */
+ public BitsType(List<Bit> bits, String units) {
+ super();
+ this.bits = Collections.unmodifiableList(bits);
+ this.units = units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public BitsTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return bits;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List<Bit> getBits() {
+ return bits;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((bits == null) ? 0 : bits.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ BitsType other = (BitsType) obj;
+ if (bits == null) {
+ if (other.bits != null) {
+ return false;
+ }
+ } else if (!bits.equals(other.bits)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BitsType [name=");
+ builder.append(name);
+ builder.append(", path=");
+ builder.append(path);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", bits=");
+ builder.append(bits);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.BooleanTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Boolean Type Definition interface.\r
- * \r
- * @see BooleanTypeDefinition\r
- */\r
-public class BooleanType implements BooleanTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("boolean");\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final String description = "The boolean built-in type represents a boolean value.";\r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.5";\r
-\r
- private final Boolean defaultValue;\r
- private String units = "";\r
-\r
- /**\r
- * Default constructor with default value set to "false".\r
- */\r
- public BooleanType() {\r
- super();\r
- defaultValue = false;\r
- }\r
-\r
- /**\r
- * Boolean Type constructor.\r
- * \r
- * @param defaultValue Default Value\r
- */\r
- public BooleanType(final Boolean defaultValue) {\r
- super();\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /**\r
- * Boolean Type constructor.\r
- * \r
- * @param defaultValue Default Value\r
- * @param units Units\r
- */\r
- public BooleanType(final Boolean defaultValue, final String units) {\r
- super();\r
- this.defaultValue = defaultValue;\r
- this.units = units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public BooleanTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- BooleanType other = (BooleanType) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("BooleanType [name=");\r
- builder.append(name);\r
- builder.append(", path=");\r
- builder.append(path);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.BooleanTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of Boolean Type Definition interface.
+ *
+ * @see BooleanTypeDefinition
+ */
+public class BooleanType implements BooleanTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("boolean");
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final String description = "The boolean built-in type represents a boolean value.";
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.5";
+
+ private final Boolean defaultValue;
+ private String units = "";
+
+ /**
+ * Default constructor with default value set to "false".
+ */
+ public BooleanType() {
+ super();
+ defaultValue = false;
+ }
+
+ /**
+ * Boolean Type constructor.
+ *
+ * @param defaultValue Default Value
+ */
+ public BooleanType(final Boolean defaultValue) {
+ super();
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * Boolean Type constructor.
+ *
+ * @param defaultValue Default Value
+ * @param units Units
+ */
+ public BooleanType(final Boolean defaultValue, final String units) {
+ super();
+ this.defaultValue = defaultValue;
+ this.units = units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public BooleanTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ BooleanType other = (BooleanType) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("BooleanType [name=");
+ builder.append(name);
+ builder.append(", path=");
+ builder.append(path);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.math.BigDecimal;\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.DecimalTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Decimal Type Definition interface.\r
- * \r
- * \r
- * @see DecimalTypeDefinition\r
- */\r
-public class Decimal64 implements DecimalTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("decimal64");\r
- private final SchemaPath path;\r
- private String units = "";\r
- private BigDecimal defaultValue = null;\r
-\r
- private final String description = "The decimal64 type represents a subset of the real numbers, which can "\r
- + "be represented by decimal numerals. The value space of decimal64 is the set of numbers that can "\r
- + "be obtained by multiplying a 64-bit signed integer by a negative power of ten, i.e., expressible as "\r
- + "'i x 10^-n' where i is an integer64 and n is an integer between 1 and 18, inclusively.";\r
-\r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.3";\r
-\r
- private final List<RangeConstraint> rangeStatements;\r
- private final Integer fractionDigits;\r
-\r
- /**\r
- * Default Decimal64 Type Constructor. <br>\r
- * <br>\r
- * The initial range statements are set to Decimal64\r
- * <code>min=-922337203685477580.8</code> and\r
- * <code>max=922337203685477580.7</code> <br>\r
- * The fractions digits MUST be defined as integer between 1 and 18\r
- * inclusively as defined interface {@link DecimalTypeDefinition} <br>\r
- * If the fraction digits are not defined inner the definition boundaries\r
- * the constructor will throw {@link IllegalArgumentException}\r
- * \r
- * @param fractionDigits\r
- * integer between 1 and 18 inclusively\r
- * \r
- * @see DecimalTypeDefinition\r
- * @exception IllegalArgumentException\r
- */\r
- public Decimal64(final Integer fractionDigits) {\r
- super();\r
- if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) {\r
- throw new IllegalArgumentException(\r
- "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively");\r
- }\r
- this.fractionDigits = fractionDigits;\r
- rangeStatements = defaultRangeStatements();\r
- this.path = BaseTypes.schemaPath(name);\r
- }\r
-\r
- /**\r
- * Decimal64 Type Constructor. <br>\r
- * \r
- * If parameter <code>Range Statements</code> is <code>null</code> or\r
- * defined as <code>empty List</code> the constructor automatically assigns\r
- * the boundaries as min and max value defined for Decimal64 in <a\r
- * href="https://tools.ietf.org/html/rfc6020#section-9.3">[RFC-6020] The\r
- * decimal64 Built-In Type</a> <br>\r
- * <br>\r
- * The fractions digits MUST be defined as integer between 1 and 18\r
- * inclusively as defined interface {@link DecimalTypeDefinition} <br>\r
- * If the fraction digits are not defined inner the definition boundaries\r
- * the constructor will throw {@link IllegalArgumentException}\r
- * \r
- * @param rangeStatements\r
- * Range Constraint Statements\r
- * @param fractionDigits\r
- * integer between 1 and 18 inclusively\r
- * @exception IllegalArgumentException\r
- */\r
- public Decimal64(final List<RangeConstraint> rangeStatements,\r
- Integer fractionDigits) {\r
- super();\r
- if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) {\r
- throw new IllegalArgumentException(\r
- "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively");\r
- }\r
- if (rangeStatements == null || rangeStatements.isEmpty()) {\r
- this.rangeStatements = defaultRangeStatements();\r
- } else {\r
- this.rangeStatements = Collections.unmodifiableList(rangeStatements);\r
- }\r
- this.fractionDigits = fractionDigits;\r
- this.path = BaseTypes.schemaPath(name);\r
- }\r
-\r
- /**\r
- * Decimal64 Type Constructor. <br>\r
- * If parameter <code>Range Statements</code> is <code>null</code> or\r
- * defined as <code>empty List</code> the constructor automatically assigns\r
- * the boundaries as min and max value defined for Decimal64 in <a\r
- * href="https://tools.ietf.org/html/rfc6020#section-9.3">[RFC-6020] The\r
- * decimal64 Built-In Type</a> <br>\r
- * <br>\r
- * The fractions digits MUST be defined as integer between 1 and 18\r
- * inclusively as defined interface {@link DecimalTypeDefinition} <br>\r
- * If the fraction digits are not defined inner the definition boundaries\r
- * the constructor will throw {@link IllegalArgumentException}\r
- * \r
- * @param units\r
- * units associated with the type\r
- * @param defaultValue\r
- * Default Value for type\r
- * @param rangeStatements\r
- * Range Constraint Statements\r
- * @param fractionDigits\r
- * integer between 1 and 18 inclusively\r
- * \r
- * @exception IllegalArgumentException\r
- */\r
- public Decimal64(final String units, final BigDecimal defaultValue,\r
- final List<RangeConstraint> rangeStatements,\r
- final Integer fractionDigits) {\r
- super();\r
- if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) {\r
- throw new IllegalArgumentException(\r
- "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively");\r
- }\r
-\r
- if (rangeStatements == null || rangeStatements.isEmpty()) {\r
- this.rangeStatements = defaultRangeStatements();\r
- \r
- } else {\r
- this.rangeStatements = Collections.unmodifiableList(rangeStatements);\r
- }\r
- this.units = units;\r
- this.defaultValue = defaultValue;\r
- this.fractionDigits = fractionDigits;\r
- this.path = BaseTypes.schemaPath(name);\r
- }\r
-\r
- /**\r
- * Returns unmodifiable List with default definition of Range Statements.\r
- * \r
- * @return unmodifiable List with default definition of Range Statements.\r
- */\r
- private List<RangeConstraint> defaultRangeStatements() {\r
- final List<RangeConstraint> rangeStatements = new ArrayList<RangeConstraint>();\r
- final BigDecimal min = new BigDecimal("-922337203685477580.8");\r
- final BigDecimal max = new BigDecimal("922337203685477580.7");\r
- final String rangeDescription = "Integer values between " + min\r
- + " and " + max + ", inclusively.";\r
- rangeStatements.add(BaseConstraints.rangeConstraint(min, max,\r
- rangeDescription,\r
- "https://tools.ietf.org/html/rfc6020#section-9.2.4"));\r
- return Collections.unmodifiableList(rangeStatements);\r
- }\r
-\r
- @Override\r
- public DecimalTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- @Override\r
- public List<RangeConstraint> getRangeStatements() {\r
- return rangeStatements;\r
- }\r
-\r
- @Override\r
- public Integer getFractionDigits() {\r
- return fractionDigits;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Decimal64 other = (Decimal64) obj;\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return Decimal64.class.getSimpleName() + "[qname=" + name\r
- + ", fractionDigits=" + fractionDigits + "]";\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.DecimalTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+
+/**
+ * The <code>default</code> implementation of Decimal Type Definition interface.
+ *
+ *
+ * @see DecimalTypeDefinition
+ */
+public class Decimal64 implements DecimalTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("decimal64");
+ private final SchemaPath path;
+ private String units = "";
+ private BigDecimal defaultValue = null;
+
+ private final String description = "The decimal64 type represents a subset of the real numbers, which can "
+ + "be represented by decimal numerals. The value space of decimal64 is the set of numbers that can "
+ + "be obtained by multiplying a 64-bit signed integer by a negative power of ten, i.e., expressible as "
+ + "'i x 10^-n' where i is an integer64 and n is an integer between 1 and 18, inclusively.";
+
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.3";
+
+ private final List<RangeConstraint> rangeStatements;
+ private final Integer fractionDigits;
+
+ /**
+ * Default Decimal64 Type Constructor. <br>
+ * <br>
+ * The initial range statements are set to Decimal64
+ * <code>min=-922337203685477580.8</code> and
+ * <code>max=922337203685477580.7</code> <br>
+ * The fractions digits MUST be defined as integer between 1 and 18
+ * inclusively as defined interface {@link DecimalTypeDefinition} <br>
+ * If the fraction digits are not defined inner the definition boundaries
+ * the constructor will throw {@link IllegalArgumentException}
+ *
+ * @param fractionDigits
+ * integer between 1 and 18 inclusively
+ *
+ * @see DecimalTypeDefinition
+ * @exception IllegalArgumentException
+ */
+ public Decimal64(final Integer fractionDigits) {
+ super();
+ if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) {
+ throw new IllegalArgumentException(
+ "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively");
+ }
+ this.fractionDigits = fractionDigits;
+ rangeStatements = defaultRangeStatements();
+ this.path = BaseTypes.schemaPath(name);
+ }
+
+ /**
+ * Decimal64 Type Constructor. <br>
+ *
+ * If parameter <code>Range Statements</code> is <code>null</code> or
+ * defined as <code>empty List</code> the constructor automatically assigns
+ * the boundaries as min and max value defined for Decimal64 in <a
+ * href="https://tools.ietf.org/html/rfc6020#section-9.3">[RFC-6020] The
+ * decimal64 Built-In Type</a> <br>
+ * <br>
+ * The fractions digits MUST be defined as integer between 1 and 18
+ * inclusively as defined interface {@link DecimalTypeDefinition} <br>
+ * If the fraction digits are not defined inner the definition boundaries
+ * the constructor will throw {@link IllegalArgumentException}
+ *
+ * @param rangeStatements
+ * Range Constraint Statements
+ * @param fractionDigits
+ * integer between 1 and 18 inclusively
+ * @exception IllegalArgumentException
+ */
+ public Decimal64(final List<RangeConstraint> rangeStatements,
+ Integer fractionDigits) {
+ super();
+ if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) {
+ throw new IllegalArgumentException(
+ "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively");
+ }
+ if (rangeStatements == null || rangeStatements.isEmpty()) {
+ this.rangeStatements = defaultRangeStatements();
+ } else {
+ this.rangeStatements = Collections.unmodifiableList(rangeStatements);
+ }
+ this.fractionDigits = fractionDigits;
+ this.path = BaseTypes.schemaPath(name);
+ }
+
+ /**
+ * Decimal64 Type Constructor. <br>
+ * If parameter <code>Range Statements</code> is <code>null</code> or
+ * defined as <code>empty List</code> the constructor automatically assigns
+ * the boundaries as min and max value defined for Decimal64 in <a
+ * href="https://tools.ietf.org/html/rfc6020#section-9.3">[RFC-6020] The
+ * decimal64 Built-In Type</a> <br>
+ * <br>
+ * The fractions digits MUST be defined as integer between 1 and 18
+ * inclusively as defined interface {@link DecimalTypeDefinition} <br>
+ * If the fraction digits are not defined inner the definition boundaries
+ * the constructor will throw {@link IllegalArgumentException}
+ *
+ * @param units
+ * units associated with the type
+ * @param defaultValue
+ * Default Value for type
+ * @param rangeStatements
+ * Range Constraint Statements
+ * @param fractionDigits
+ * integer between 1 and 18 inclusively
+ *
+ * @exception IllegalArgumentException
+ */
+ public Decimal64(final String units, final BigDecimal defaultValue,
+ final List<RangeConstraint> rangeStatements,
+ final Integer fractionDigits) {
+ super();
+ if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) {
+ throw new IllegalArgumentException(
+ "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively");
+ }
+
+ if (rangeStatements == null || rangeStatements.isEmpty()) {
+ this.rangeStatements = defaultRangeStatements();
+
+ } else {
+ this.rangeStatements = Collections.unmodifiableList(rangeStatements);
+ }
+ this.units = units;
+ this.defaultValue = defaultValue;
+ this.fractionDigits = fractionDigits;
+ this.path = BaseTypes.schemaPath(name);
+ }
+
+ /**
+ * Returns unmodifiable List with default definition of Range Statements.
+ *
+ * @return unmodifiable List with default definition of Range Statements.
+ */
+ private List<RangeConstraint> defaultRangeStatements() {
+ final List<RangeConstraint> rangeStatements = new ArrayList<RangeConstraint>();
+ final BigDecimal min = new BigDecimal("-922337203685477580.8");
+ final BigDecimal max = new BigDecimal("922337203685477580.7");
+ final String rangeDescription = "Integer values between " + min
+ + " and " + max + ", inclusively.";
+ rangeStatements.add(BaseConstraints.rangeConstraint(min, max,
+ rangeDescription,
+ "https://tools.ietf.org/html/rfc6020#section-9.2.4"));
+ return Collections.unmodifiableList(rangeStatements);
+ }
+
+ @Override
+ public DecimalTypeDefinition getBaseType() {
+ return this;
+ }
+
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List<RangeConstraint> getRangeStatements() {
+ return rangeStatements;
+ }
+
+ @Override
+ public Integer getFractionDigits() {
+ return fractionDigits;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Decimal64 other = (Decimal64) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return Decimal64.class.getSimpleName() + "[qname=" + name
+ + ", fractionDigits=" + fractionDigits + "]";
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.EnumTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Enumertaion Type Definition interface.\r
- * \r
- * @see EnumTypeDefinition\r
- */\r
-public class EnumerationType implements EnumTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("enumeration");\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final String description = "The enumeration built-in type represents values from a set of assigned names.";\r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.6";\r
-\r
- private final List<EnumPair> defaultEnum;\r
- private final List<EnumPair> enums;\r
- private String units = "";\r
-\r
- public EnumerationType(final List<EnumPair> enums) {\r
- super();\r
- this.enums = Collections.unmodifiableList(enums);\r
- defaultEnum = Collections.emptyList();\r
- }\r
-\r
- public EnumerationType(final List<EnumPair> defaultEnum,\r
- final List<EnumPair> enums, final String units) {\r
- super();\r
- this.defaultEnum = Collections.unmodifiableList(defaultEnum);\r
- this.enums = Collections.unmodifiableList(enums);\r
- this.units = units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public EnumTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultEnum;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.base.type.api.EnumTypeDefinition#getValues()\r
- */\r
- @Override\r
- public List<EnumPair> getValues() {\r
- return enums;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((defaultEnum == null) ? 0 : defaultEnum.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result + ((enums == null) ? 0 : enums.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- EnumerationType other = (EnumerationType) obj;\r
- if (defaultEnum == null) {\r
- if (other.defaultEnum != null) {\r
- return false;\r
- }\r
- } else if (!defaultEnum.equals(other.defaultEnum)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (enums == null) {\r
- if (other.enums != null) {\r
- return false;\r
- }\r
- } else if (!enums.equals(other.enums)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("EnumerationType [name=");\r
- builder.append(name);\r
- builder.append(", path=");\r
- builder.append(path);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", defaultEnum=");\r
- builder.append(defaultEnum);\r
- builder.append(", enums=");\r
- builder.append(enums);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of Enumertaion Type Definition interface.
+ *
+ * @see EnumTypeDefinition
+ */
+public class EnumerationType implements EnumTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("enumeration");
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final String description = "The enumeration built-in type represents values from a set of assigned names.";
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.6";
+
+ private final List<EnumPair> defaultEnum;
+ private final List<EnumPair> enums;
+ private String units = "";
+
+ public EnumerationType(final List<EnumPair> enums) {
+ super();
+ this.enums = Collections.unmodifiableList(enums);
+ defaultEnum = Collections.emptyList();
+ }
+
+ public EnumerationType(final List<EnumPair> defaultEnum,
+ final List<EnumPair> enums, final String units) {
+ super();
+ this.defaultEnum = Collections.unmodifiableList(defaultEnum);
+ this.enums = Collections.unmodifiableList(enums);
+ this.units = units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public EnumTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultEnum;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.base.type.api.EnumTypeDefinition#getValues()
+ */
+ @Override
+ public List<EnumPair> getValues() {
+ return enums;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((defaultEnum == null) ? 0 : defaultEnum.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((enums == null) ? 0 : enums.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ EnumerationType other = (EnumerationType) obj;
+ if (defaultEnum == null) {
+ if (other.defaultEnum != null) {
+ return false;
+ }
+ } else if (!defaultEnum.equals(other.defaultEnum)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (enums == null) {
+ if (other.enums != null) {
+ return false;
+ }
+ } else if (!enums.equals(other.enums)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("EnumerationType [name=");
+ builder.append(name);
+ builder.append(", path=");
+ builder.append(path);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", defaultEnum=");
+ builder.append(defaultEnum);
+ builder.append(", enums=");
+ builder.append(enums);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-public class ExtendedType implements TypeDefinition {\r
-\r
- private final QName typeName;\r
- private final TypeDefinition<?> baseType;\r
- private final SchemaPath path;\r
- private final String description;\r
- private final String reference;\r
- private final List<UnknownSchemaNode> unknownSchemaNodes;\r
-\r
- private Status status;\r
- private String units;\r
- private Object defaultValue;\r
-\r
- public static class Builder {\r
- private final QName typeName;\r
- private final TypeDefinition<?> baseType;\r
-\r
- private final SchemaPath path;\r
- private final String description;\r
- private final String reference;\r
-\r
- private List<UnknownSchemaNode> unknownSchemaNodes = Collections.emptyList();;\r
- private Status status = Status.CURRENT;\r
- private String units = "";\r
- private Object defaultValue = null;\r
-\r
- public Builder(final QName typeName, TypeDefinition<?> baseType,\r
- final String description, final String reference) {\r
- this.typeName = typeName;\r
- this.baseType = baseType;\r
- this.path = BaseTypes.schemaPath(typeName);\r
- this.description = description;\r
- this.reference = reference;\r
- }\r
-\r
- public Builder status(Status status) {\r
- this.status = status;\r
- return this;\r
- }\r
-\r
- public Builder units(String units) {\r
- this.units = units;\r
- return this;\r
- }\r
-\r
- public Builder defaultValue(final Object defaultValue) {\r
- this.defaultValue = defaultValue;\r
- return this;\r
- }\r
-\r
- public Builder unknownSchemaNodes(final List<UnknownSchemaNode> unknownSchemaNodes) {\r
- this.unknownSchemaNodes = unknownSchemaNodes;\r
- return this;\r
- }\r
-\r
- public ExtendedType build() {\r
- return new ExtendedType(this);\r
- }\r
- }\r
-\r
- private ExtendedType(Builder builder) {\r
- this.typeName = builder.typeName;\r
- this.baseType = builder.baseType;\r
- this.path = builder.path;\r
- this.description = builder.description;\r
- this.reference = builder.reference;\r
- this.unknownSchemaNodes = builder.unknownSchemaNodes;\r
- this.status = builder.status;\r
- this.units = builder.units;\r
- this.defaultValue = builder.defaultValue;\r
- }\r
-\r
- @Override\r
- public TypeDefinition<?> getBaseType() {\r
- return baseType;\r
- }\r
-\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public QName getQName() {\r
- return typeName;\r
- }\r
-\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- @Override\r
- public Status getStatus() {\r
- return status;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return unknownSchemaNodes;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((baseType == null) ? 0 : baseType.hashCode());\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result\r
- + ((unknownSchemaNodes == null) ? 0 : unknownSchemaNodes.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((status == null) ? 0 : status.hashCode());\r
- result = prime * result\r
- + ((typeName == null) ? 0 : typeName.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- ExtendedType other = (ExtendedType) obj;\r
- if (baseType == null) {\r
- if (other.baseType != null) {\r
- return false;\r
- }\r
- } else if (!baseType.equals(other.baseType)) {\r
- return false;\r
- }\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (unknownSchemaNodes == null) {\r
- if (other.unknownSchemaNodes != null) {\r
- return false;\r
- }\r
- } else if (!unknownSchemaNodes.equals(other.unknownSchemaNodes)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (status != other.status) {\r
- return false;\r
- }\r
- if (typeName == null) {\r
- if (other.typeName != null) {\r
- return false;\r
- }\r
- } else if (!typeName.equals(other.typeName)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder2 = new StringBuilder();\r
- builder2.append("ExtendedType [typeName=");\r
- builder2.append(typeName);\r
- builder2.append(", baseType=");\r
- builder2.append(baseType);\r
- builder2.append(", path=");\r
- builder2.append(path);\r
- builder2.append(", description=");\r
- builder2.append(description);\r
- builder2.append(", reference=");\r
- builder2.append(reference);\r
- builder2.append(", unknownSchemaNodes=");\r
- builder2.append(unknownSchemaNodes);\r
- builder2.append(", status=");\r
- builder2.append(status);\r
- builder2.append(", units=");\r
- builder2.append(units);\r
- builder2.append(", defaultValue=");\r
- builder2.append(defaultValue);\r
- builder2.append("]");\r
- return builder2.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+
+public class ExtendedType implements TypeDefinition {
+
+ private final QName typeName;
+ private final TypeDefinition<?> baseType;
+ private final SchemaPath path;
+ private final String description;
+ private final String reference;
+ private final List<UnknownSchemaNode> unknownSchemaNodes;
+
+ private Status status;
+ private String units;
+ private Object defaultValue;
+
+ public static class Builder {
+ private final QName typeName;
+ private final TypeDefinition<?> baseType;
+
+ private final SchemaPath path;
+ private final String description;
+ private final String reference;
+
+ private List<UnknownSchemaNode> unknownSchemaNodes = Collections.emptyList();;
+ private Status status = Status.CURRENT;
+ private String units = "";
+ private Object defaultValue = null;
+
+ public Builder(final QName typeName, TypeDefinition<?> baseType,
+ final String description, final String reference) {
+ this.typeName = typeName;
+ this.baseType = baseType;
+ this.path = BaseTypes.schemaPath(typeName);
+ this.description = description;
+ this.reference = reference;
+ }
+
+ public Builder status(Status status) {
+ this.status = status;
+ return this;
+ }
+
+ public Builder units(String units) {
+ this.units = units;
+ return this;
+ }
+
+ public Builder defaultValue(final Object defaultValue) {
+ this.defaultValue = defaultValue;
+ return this;
+ }
+
+ public Builder unknownSchemaNodes(final List<UnknownSchemaNode> unknownSchemaNodes) {
+ this.unknownSchemaNodes = unknownSchemaNodes;
+ return this;
+ }
+
+ public ExtendedType build() {
+ return new ExtendedType(this);
+ }
+ }
+
+ private ExtendedType(Builder builder) {
+ this.typeName = builder.typeName;
+ this.baseType = builder.baseType;
+ this.path = builder.path;
+ this.description = builder.description;
+ this.reference = builder.reference;
+ this.unknownSchemaNodes = builder.unknownSchemaNodes;
+ this.status = builder.status;
+ this.units = builder.units;
+ this.defaultValue = builder.defaultValue;
+ }
+
+ @Override
+ public TypeDefinition<?> getBaseType() {
+ return baseType;
+ }
+
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public QName getQName() {
+ return typeName;
+ }
+
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ @Override
+ public Status getStatus() {
+ return status;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return unknownSchemaNodes;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((baseType == null) ? 0 : baseType.hashCode());
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result
+ + ((unknownSchemaNodes == null) ? 0 : unknownSchemaNodes.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((status == null) ? 0 : status.hashCode());
+ result = prime * result
+ + ((typeName == null) ? 0 : typeName.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ExtendedType other = (ExtendedType) obj;
+ if (baseType == null) {
+ if (other.baseType != null) {
+ return false;
+ }
+ } else if (!baseType.equals(other.baseType)) {
+ return false;
+ }
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (unknownSchemaNodes == null) {
+ if (other.unknownSchemaNodes != null) {
+ return false;
+ }
+ } else if (!unknownSchemaNodes.equals(other.unknownSchemaNodes)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (status != other.status) {
+ return false;
+ }
+ if (typeName == null) {
+ if (other.typeName != null) {
+ return false;
+ }
+ } else if (!typeName.equals(other.typeName)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder2 = new StringBuilder();
+ builder2.append("ExtendedType [typeName=");
+ builder2.append(typeName);
+ builder2.append(", baseType=");
+ builder2.append(baseType);
+ builder2.append(", path=");
+ builder2.append(path);
+ builder2.append(", description=");
+ builder2.append(description);
+ builder2.append(", reference=");
+ builder2.append(reference);
+ builder2.append(", unknownSchemaNodes=");
+ builder2.append(unknownSchemaNodes);
+ builder2.append(", status=");
+ builder2.append(status);
+ builder2.append(", units=");
+ builder2.append(units);
+ builder2.append(", defaultValue=");
+ builder2.append(defaultValue);
+ builder2.append("]");
+ return builder2.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.IdentityTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Identity Type Definition interface.\r
- * \r
- * @see IdentityTypeDefinition\r
- */\r
-public class IdentityType implements IdentityTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("identity");\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final String description = "The 'identity' statement is used to define a new " +\r
- "globally unique, abstract, and untyped identity.";\r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-7.16";\r
-\r
- private String units = "";\r
- private final QName identityName;\r
-\r
- public IdentityType(QName identityName) {\r
- super();\r
- this.identityName = identityName;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public IdentityTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.base.type.api.IdentityTypeDefinition#getIdentityName\r
- * ()\r
- */\r
- @Override\r
- public QName getIdentityName() {\r
- return identityName;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result\r
- + ((identityName == null) ? 0 : identityName.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- IdentityType other = (IdentityType) obj;\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (identityName == null) {\r
- if (other.identityName != null) {\r
- return false;\r
- }\r
- } else if (!identityName.equals(other.identityName)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("IdentityType [name=");\r
- builder.append(name);\r
- builder.append(", path=");\r
- builder.append(path);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append(", identityName=");\r
- builder.append(identityName);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.IdentityTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of Identity Type Definition interface.
+ *
+ * @see IdentityTypeDefinition
+ */
+public class IdentityType implements IdentityTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("identity");
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final String description = "The 'identity' statement is used to define a new " +
+ "globally unique, abstract, and untyped identity.";
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-7.16";
+
+ private String units = "";
+ private final QName identityName;
+
+ public IdentityType(QName identityName) {
+ super();
+ this.identityName = identityName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public IdentityTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.base.type.api.IdentityTypeDefinition#getIdentityName
+ * ()
+ */
+ @Override
+ public QName getIdentityName() {
+ return identityName;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result
+ + ((identityName == null) ? 0 : identityName.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ IdentityType other = (IdentityType) obj;
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (identityName == null) {
+ if (other.identityName != null) {
+ return false;
+ }
+ } else if (!identityName.equals(other.identityName)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("IdentityType [name=");
+ builder.append(name);
+ builder.append(", path=");
+ builder.append(path);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append(", identityName=");
+ builder.append(identityName);
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.IdentityTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.IdentityrefTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Identityref Type Definition interface.\r
- *\r
- * @see IdentityrefTypeDefinition\r
- */\r
-public class Identityref implements IdentityrefTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("identityref");\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final String description = "The identityref type is used to reference an existing identity.";\r
- private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.10";\r
-\r
- private final IdentityTypeDefinition identity;\r
- private final RevisionAwareXPath xpath;\r
-\r
- private String units = "";\r
-\r
- public Identityref(RevisionAwareXPath xpath, IdentityTypeDefinition identity) {\r
- super();\r
- this.identity = identity;\r
- this.xpath = xpath;\r
- }\r
- \r
- public Identityref(RevisionAwareXPath xpath) {\r
- super();\r
- this.xpath = xpath;\r
- this.identity = null;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public IdentityTypeDefinition getBaseType() {\r
- return identity;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return identity;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.base.type.api.IdentityrefTypeDefinition#getIdentityName\r
- * ()\r
- */\r
- @Override\r
- public IdentityTypeDefinition getIdentity() {\r
- return identity;\r
- }\r
- \r
- @Override\r
- public RevisionAwareXPath getPathStatement() {\r
- return xpath;\r
- }\r
- \r
- \r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.IdentityTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.IdentityrefTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of Identityref Type Definition interface.
+ *
+ * @see IdentityrefTypeDefinition
+ */
+public class Identityref implements IdentityrefTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("identityref");
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final String description = "The identityref type is used to reference an existing identity.";
+ private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.10";
+
+ private final IdentityTypeDefinition identity;
+ private final RevisionAwareXPath xpath;
+
+ private String units = "";
+
+ public Identityref(RevisionAwareXPath xpath, IdentityTypeDefinition identity) {
+ super();
+ this.identity = identity;
+ this.xpath = xpath;
+ }
+
+ public Identityref(RevisionAwareXPath xpath) {
+ super();
+ this.xpath = xpath;
+ this.identity = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public IdentityTypeDefinition getBaseType() {
+ return identity;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return identity;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.base.type.api.IdentityrefTypeDefinition#getIdentityName
+ * ()
+ */
+ @Override
+ public IdentityTypeDefinition getIdentity() {
+ return identity;
+ }
+
+ @Override
+ public RevisionAwareXPath getPathStatement() {
+ return xpath;
+ }
+
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.InstanceIdentifierTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Instance Identifier Type Definition interface.\r
- *\r
- * @see InstanceIdentifierTypeDefinition\r
- */\r
-public class InstanceIdentifier implements InstanceIdentifierTypeDefinition {\r
-\r
- private static final QName name = BaseTypes\r
- .constructQName("instance-identifier");\r
- private static final String description = "The instance-identifier built-in type is used to " +\r
- "uniquely identify a particular instance node in the data tree.";\r
- private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.13";\r
-\r
- private final transient SchemaPath path = BaseTypes.schemaPath(name);\r
- private final RevisionAwareXPath xpath;\r
- private final String units = "";\r
-\r
- private final boolean requireInstance;\r
-\r
- public InstanceIdentifier(RevisionAwareXPath xpath, boolean requireInstance) {\r
- super();\r
- this.xpath = xpath;\r
- this.requireInstance = requireInstance;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public InstanceIdentifierTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return xpath;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()\r
- */\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#\r
- * getPathStatement()\r
- */\r
- @Override\r
- public RevisionAwareXPath getPathStatement() {\r
- return xpath;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#\r
- * requireInstance()\r
- */\r
- @Override\r
- public boolean requireInstance() {\r
- return requireInstance;\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of Instance Identifier Type Definition interface.
+ *
+ * @see InstanceIdentifierTypeDefinition
+ */
+public class InstanceIdentifier implements InstanceIdentifierTypeDefinition {
+
+ private static final QName name = BaseTypes
+ .constructQName("instance-identifier");
+ private static final String description = "The instance-identifier built-in type is used to " +
+ "uniquely identify a particular instance node in the data tree.";
+ private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.13";
+
+ private final transient SchemaPath path = BaseTypes.schemaPath(name);
+ private final RevisionAwareXPath xpath;
+ private final String units = "";
+
+ private final boolean requireInstance;
+
+ public InstanceIdentifier(RevisionAwareXPath xpath, boolean requireInstance) {
+ super();
+ this.xpath = xpath;
+ this.requireInstance = requireInstance;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public InstanceIdentifierTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return xpath;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()
+ */
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
+ * getPathStatement()
+ */
+ @Override
+ public RevisionAwareXPath getPathStatement() {
+ return xpath;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
+ * requireInstance()
+ */
+ @Override
+ public boolean requireInstance() {
+ return requireInstance;
+ }
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang int16 built-in type. <br>\r
- * int16 represents integer values between -32768 and 32767, inclusively. The\r
- * Java counterpart of Yang int16 built-in type is {@link Short}.\r
- * \r
- * @see AbstractSignedInteger\r
- */\r
-public class Int16 extends AbstractSignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("int16");\r
- private Short defaultValue = null;\r
- private static final String description = \r
- "int16 represents integer values between -32768 and 32767, inclusively.";\r
-\r
- public Int16() {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- }\r
-\r
- public Int16(final List<RangeConstraint> rangeStatements,\r
- final String units, final Short defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- @Override\r
- public IntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Int16 other = (Int16) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Int16 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+
+/**
+ * Implementation of Yang int16 built-in type. <br>
+ * int16 represents integer values between -32768 and 32767, inclusively. The
+ * Java counterpart of Yang int16 built-in type is {@link Short}.
+ *
+ * @see AbstractSignedInteger
+ */
+public class Int16 extends AbstractSignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("int16");
+ private Short defaultValue = null;
+ private static final String description =
+ "int16 represents integer values between -32768 and 32767, inclusively.";
+
+ public Int16() {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ }
+
+ public Int16(final List<RangeConstraint> rangeStatements,
+ final String units, final Short defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public IntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Int16 other = (Int16) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Int16 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang int32 built-in type. <br>\r
- * int32 represents integer values between -2147483648 and 2147483647,\r
- * inclusively. The Java counterpart of Yang int32 built-in type is\r
- * {@link Integer}.\r
- * \r
- * @see AbstractSignedInteger\r
- * \r
- */\r
-public class Int32 extends AbstractSignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("int32");\r
- private Integer defaultValue = null;\r
- private static final String description = \r
- "int32 represents integer values between -2147483648 and 2147483647, inclusively.";\r
-\r
- public Int32() {\r
- super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");\r
- }\r
-\r
- public Int32(final Integer defaultValue) {\r
- super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Int32(final List<RangeConstraint> rangeStatements,\r
- final String units, final Integer defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public IntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue\r
- * ()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Int32 other = (Int32) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Int32 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+
+/**
+ * Implementation of Yang int32 built-in type. <br>
+ * int32 represents integer values between -2147483648 and 2147483647,
+ * inclusively. The Java counterpart of Yang int32 built-in type is
+ * {@link Integer}.
+ *
+ * @see AbstractSignedInteger
+ *
+ */
+public class Int32 extends AbstractSignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("int32");
+ private Integer defaultValue = null;
+ private static final String description =
+ "int32 represents integer values between -2147483648 and 2147483647, inclusively.";
+
+ public Int32() {
+ super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+ }
+
+ public Int32(final Integer defaultValue) {
+ super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Int32(final List<RangeConstraint> rangeStatements,
+ final String units, final Integer defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public IntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
+ * ()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Int32 other = (Int32) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Int32 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang int64 built-in type. <br>\r
- * int64 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively. \r
- * The Java counterpart of Yang int64 built-in type is\r
- * {@link Long}.\r
- *\r
- */\r
-public class Int64 extends AbstractSignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("int64");\r
- private Long defaultValue = null;\r
- private static final String description = \r
- "int64 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.";\r
-\r
- public Int64() {\r
- super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");\r
- }\r
-\r
- public Int64(final Long defaultValue) {\r
- super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Int64(final List<RangeConstraint> rangeStatements,\r
- final String units, final Long defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public IntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Int64 other = (Int64) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Int64 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+
+/**
+ * Implementation of Yang int64 built-in type. <br>
+ * int64 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.
+ * The Java counterpart of Yang int64 built-in type is
+ * {@link Long}.
+ *
+ */
+public class Int64 extends AbstractSignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("int64");
+ private Long defaultValue = null;
+ private static final String description =
+ "int64 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.";
+
+ public Int64() {
+ super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+ }
+
+ public Int64(final Long defaultValue) {
+ super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Int64(final List<RangeConstraint> rangeStatements,
+ final String units, final Long defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public IntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Int64 other = (Int64) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Int64 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang int8 built-in type.\r
- * <br>\r
- * int8 represents integer values between -128 and 127, inclusively. The Java counterpart of \r
- * Yang int8 built-in type is {@link Byte}.\r
- * \r
- * @see AbstractSignedInteger\r
- */\r
-public class Int8 extends AbstractSignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("int8");\r
- private Byte defaultValue = null;\r
- private static final String description = \r
- "represents integer values between -128 and 127, inclusively.";\r
- \r
- public Int8() {\r
- super(name, description, Byte.MIN_VALUE, Byte.MAX_VALUE, "");\r
- }\r
-\r
- public Int8(final Byte defaultValue) {\r
- super(name, description, Byte.MIN_VALUE, Byte.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Int8(final List<RangeConstraint> rangeStatements,\r
- final String units, final Byte defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public IntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Int8 other = (Int8) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Int8 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+
+/**
+ * Implementation of Yang int8 built-in type.
+ * <br>
+ * int8 represents integer values between -128 and 127, inclusively. The Java counterpart of
+ * Yang int8 built-in type is {@link Byte}.
+ *
+ * @see AbstractSignedInteger
+ */
+public class Int8 extends AbstractSignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("int8");
+ private Byte defaultValue = null;
+ private static final String description =
+ "represents integer values between -128 and 127, inclusively.";
+
+ public Int8() {
+ super(name, description, Byte.MIN_VALUE, Byte.MAX_VALUE, "");
+ }
+
+ public Int8(final Byte defaultValue) {
+ super(name, description, Byte.MIN_VALUE, Byte.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Int8(final List<RangeConstraint> rangeStatements,
+ final String units, final Byte defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public IntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Int8 other = (Int8) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Int8 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.LeafrefTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of Instance Leafref Type Definition interface.\r
- *\r
- * @see LeafrefTypeDefinition\r
- */\r
-public class Leafref implements LeafrefTypeDefinition {\r
- private static final QName name = BaseTypes.constructQName("leafref");\r
- private static final String description = "The leafref type is used to reference a " +\r
- "particular leaf instance in the data tree.";\r
- private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.9";\r
- private final SchemaPath path = BaseTypes.schemaPath(name);\r
- private final RevisionAwareXPath xpath;\r
- private final String units = "";\r
-\r
- public Leafref(RevisionAwareXPath xpath) {\r
- super();\r
- this.xpath = xpath;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public LeafrefTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()\r
- */\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.type.LeafrefTypeDefinition#getPathStatement()\r
- */\r
- @Override\r
- public RevisionAwareXPath getPathStatement() {\r
- return xpath;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- result = prime * result + ((xpath == null) ? 0 : xpath.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Leafref other = (Leafref) obj;\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- if (xpath == null) {\r
- if (other.xpath != null) {\r
- return false;\r
- }\r
- } else if (!xpath.equals(other.xpath)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Leafref [path=");\r
- builder.append(path);\r
- builder.append(", xpath=");\r
- builder.append(xpath);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.LeafrefTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of Instance Leafref Type Definition interface.
+ *
+ * @see LeafrefTypeDefinition
+ */
+public class Leafref implements LeafrefTypeDefinition {
+ private static final QName name = BaseTypes.constructQName("leafref");
+ private static final String description = "The leafref type is used to reference a " +
+ "particular leaf instance in the data tree.";
+ private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.9";
+ private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final RevisionAwareXPath xpath;
+ private final String units = "";
+
+ public Leafref(RevisionAwareXPath xpath) {
+ super();
+ this.xpath = xpath;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public LeafrefTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()
+ */
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.type.LeafrefTypeDefinition#getPathStatement()
+ */
+ @Override
+ public RevisionAwareXPath getPathStatement() {
+ return xpath;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ result = prime * result + ((xpath == null) ? 0 : xpath.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Leafref other = (Leafref) obj;
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ if (xpath == null) {
+ if (other.xpath != null) {
+ return false;
+ }
+ } else if (!xpath.equals(other.xpath)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Leafref [path=");
+ builder.append(path);
+ builder.append(", xpath=");
+ builder.append(xpath);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append("]");
+ return builder.toString();
+ }
+}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.model.util;
+package org.opendaylight.controller.yang.model.util;
import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.LengthConstraint;\r
-import org.opendaylight.controller.model.api.type.PatternConstraint;\r
-import org.opendaylight.controller.model.api.type.StringTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-/**\r
- * The <code>default</code> implementation of String Type Definition interface.\r
- *\r
- * @see StringTypeDefinition\r
- */\r
-public class StringType implements StringTypeDefinition {\r
-\r
- private final QName name = BaseTypes.constructQName("string");;\r
- private final SchemaPath path;\r
- private String defaultValue = "";\r
- private final String description = "";\r
- private final String reference = "";\r
- private final List<LengthConstraint> lengthStatements;\r
- private final List<PatternConstraint> patterns;\r
- private String units = "";\r
-\r
- /**\r
- * Default Constructor.\r
- */\r
- public StringType() {\r
- super();\r
- path = BaseTypes.schemaPath(name);\r
- final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();\r
- constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));\r
- lengthStatements = Collections.unmodifiableList(constraints);\r
- \r
- this.patterns = Collections.emptyList();\r
- }\r
-\r
- /**\r
- * \r
- * \r
- * @param lengthStatements\r
- * @param patterns\r
- */\r
- public StringType(final List<LengthConstraint> lengthStatements,\r
- final List<PatternConstraint> patterns) {\r
- super();\r
- path = BaseTypes.schemaPath(name);\r
- this.lengthStatements = Collections.unmodifiableList(lengthStatements);\r
- this.patterns = Collections.unmodifiableList(patterns);\r
- }\r
-\r
- /**\r
- * \r
- * \r
- * @param defaultValue\r
- * @param lengthStatements\r
- * @param patterns\r
- * @param units\r
- */\r
- public StringType(final String defaultValue,\r
- final List<LengthConstraint> lengthStatements,\r
- final List<PatternConstraint> patterns, final String units) {\r
- super();\r
- path = BaseTypes.schemaPath(name);\r
- this.defaultValue = defaultValue;\r
- this.lengthStatements = lengthStatements;\r
- this.patterns = patterns;\r
- this.units = units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public StringTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return Status.CURRENT;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * com.csico.yang.model.base.type.api.StringTypeDefinition#getLengthStatements\r
- * ()\r
- */\r
- @Override\r
- public List<LengthConstraint> getLengthStatements() {\r
- return lengthStatements;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * com.csico.yang.model.base.type.api.StringTypeDefinition#getPatterns()\r
- */\r
- @Override\r
- public List<PatternConstraint> getPatterns() {\r
- return patterns;\r
- }\r
-\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return Collections.emptyList();\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime\r
- * result\r
- + ((lengthStatements == null) ? 0 : lengthStatements.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((patterns == null) ? 0 : patterns.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- StringType other = (StringType) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (lengthStatements == null) {\r
- if (other.lengthStatements != null) {\r
- return false;\r
- }\r
- } else if (!lengthStatements.equals(other.lengthStatements)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if ((path != null) && (other.path != null)) {\r
- if (!path.getPath().equals(other.path.getPath())) {\r
- return false;\r
- }\r
- }\r
- if (patterns == null) {\r
- if (other.patterns != null) {\r
- return false;\r
- }\r
- } else if (!patterns.equals(other.patterns)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("StringType [name=");\r
- builder.append(name);\r
- builder.append(", path=");\r
- builder.append(path);\r
- builder.append(", defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", description=");\r
- builder.append(description);\r
- builder.append(", reference=");\r
- builder.append(reference);\r
- builder.append(", lengthStatements=");\r
- builder.append(lengthStatements);\r
- builder.append(", patterns=");\r
- builder.append(patterns);\r
- builder.append(", units=");\r
- builder.append(units);\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.LengthConstraint;
+import org.opendaylight.controller.yang.model.api.type.PatternConstraint;
+import org.opendaylight.controller.yang.model.api.type.StringTypeDefinition;
+
+/**
+ * The <code>default</code> implementation of String Type Definition interface.
+ *
+ * @see StringTypeDefinition
+ */
+public class StringType implements StringTypeDefinition {
+
+ private final QName name = BaseTypes.constructQName("string");;
+ private final SchemaPath path;
+ private String defaultValue = "";
+ private final String description = "";
+ private final String reference = "";
+ private final List<LengthConstraint> lengthStatements;
+ private final List<PatternConstraint> patterns;
+ private String units = "";
+
+ /**
+ * Default Constructor.
+ */
+ public StringType() {
+ super();
+ path = BaseTypes.schemaPath(name);
+ final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();
+ constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
+ lengthStatements = Collections.unmodifiableList(constraints);
+
+ this.patterns = Collections.emptyList();
+ }
+
+ /**
+ *
+ *
+ * @param lengthStatements
+ * @param patterns
+ */
+ public StringType(final List<LengthConstraint> lengthStatements,
+ final List<PatternConstraint> patterns) {
+ super();
+ path = BaseTypes.schemaPath(name);
+ this.lengthStatements = Collections.unmodifiableList(lengthStatements);
+ this.patterns = Collections.unmodifiableList(patterns);
+ }
+
+ /**
+ *
+ *
+ * @param defaultValue
+ * @param lengthStatements
+ * @param patterns
+ * @param units
+ */
+ public StringType(final String defaultValue,
+ final List<LengthConstraint> lengthStatements,
+ final List<PatternConstraint> patterns, final String units) {
+ super();
+ path = BaseTypes.schemaPath(name);
+ this.defaultValue = defaultValue;
+ this.lengthStatements = lengthStatements;
+ this.patterns = patterns;
+ this.units = units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public StringTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return Status.CURRENT;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.csico.yang.model.base.type.api.StringTypeDefinition#getLengthStatements
+ * ()
+ */
+ @Override
+ public List<LengthConstraint> getLengthStatements() {
+ return lengthStatements;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.csico.yang.model.base.type.api.StringTypeDefinition#getPatterns()
+ */
+ @Override
+ public List<PatternConstraint> getPatterns() {
+ return patterns;
+ }
+
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime
+ * result
+ + ((lengthStatements == null) ? 0 : lengthStatements.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((patterns == null) ? 0 : patterns.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ StringType other = (StringType) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (lengthStatements == null) {
+ if (other.lengthStatements != null) {
+ return false;
+ }
+ } else if (!lengthStatements.equals(other.lengthStatements)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if ((path != null) && (other.path != null)) {
+ if (!path.getPath().equals(other.path.getPath())) {
+ return false;
+ }
+ }
+ if (patterns == null) {
+ if (other.patterns != null) {
+ return false;
+ }
+ } else if (!patterns.equals(other.patterns)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("StringType [name=");
+ builder.append(name);
+ builder.append(", path=");
+ builder.append(path);
+ builder.append(", defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", description=");
+ builder.append(description);
+ builder.append(", reference=");
+ builder.append(reference);
+ builder.append(", lengthStatements=");
+ builder.append(lengthStatements);
+ builder.append(", patterns=");
+ builder.append(patterns);
+ builder.append(", units=");
+ builder.append(units);
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang uint32 built-in type. <br>\r
- * uint16 represents integer values between 0 and 65535, inclusively. The Java\r
- * counterpart of Yang uint32 built-in type is {@link Integer}.\r
- * \r
- */\r
-public class Uint16 extends AbstractUnsignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("uint16");\r
- private Integer defaultValue = null;\r
- private static final String description = "uint16 represents integer values between 0 and 65535, inclusively.";\r
-\r
- public Uint16() {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- }\r
-\r
- public Uint16(final Integer defaultValue) {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Uint16(final List<RangeConstraint> rangeStatements,\r
- final String units, final Integer defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public UnsignedIntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue\r
- * ()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Uint16 other = (Uint16) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Uint16 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
+
+/**
+ * Implementation of Yang uint32 built-in type. <br>
+ * uint16 represents integer values between 0 and 65535, inclusively. The Java
+ * counterpart of Yang uint32 built-in type is {@link Integer}.
+ *
+ */
+public class Uint16 extends AbstractUnsignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("uint16");
+ private Integer defaultValue = null;
+ private static final String description = "uint16 represents integer values between 0 and 65535, inclusively.";
+
+ public Uint16() {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ }
+
+ public Uint16(final Integer defaultValue) {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Uint16(final List<RangeConstraint> rangeStatements,
+ final String units, final Integer defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public UnsignedIntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
+ * ()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Uint16 other = (Uint16) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Uint16 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang uint32 built-in type. <br>\r
- * uint32 represents integer values between 0 and 4294967295, inclusively. The\r
- * Java counterpart of Yang uint32 built-in type is {@link Long}.\r
- * \r
- */\r
-public class Uint32 extends AbstractUnsignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("uint32");\r
- private Long defaultValue = null;\r
- private static final String description = "uint32 represents integer values between 0 and 4294967295, inclusively.";\r
-\r
- public Uint32() {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- }\r
-\r
- public Uint32(final Long defaultValue) {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Uint32(final List<RangeConstraint> rangeStatements,\r
- final String units, final Long defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public UnsignedIntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue\r
- * ()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Uint32 other = (Uint32) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Uint32 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
+
+/**
+ * Implementation of Yang uint32 built-in type. <br>
+ * uint32 represents integer values between 0 and 4294967295, inclusively. The
+ * Java counterpart of Yang uint32 built-in type is {@link Long}.
+ *
+ */
+public class Uint32 extends AbstractUnsignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("uint32");
+ private Long defaultValue = null;
+ private static final String description = "uint32 represents integer values between 0 and 4294967295, inclusively.";
+
+ public Uint32() {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ }
+
+ public Uint32(final Long defaultValue) {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Uint32(final List<RangeConstraint> rangeStatements,
+ final String units, final Long defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public UnsignedIntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
+ * ()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Uint32 other = (Uint32) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Uint32 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.math.BigInteger;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang uint64 built-in type. <br>\r
- * uint64 represents integer values between 0 and 18446744073709551615,\r
- * inclusively. The Java counterpart of Yang uint64 built-in type is\r
- * {@link BigInteger}.\r
- * \r
- */\r
-public class Uint64 extends AbstractUnsignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("uint32");\r
- private BigInteger defaultValue = null;\r
- private static final String description = \r
- "uint64 represents integer values between 0 and 18446744073709551615, inclusively.";\r
-\r
- public Uint64() {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- }\r
-\r
- public Uint64(final BigInteger defaultValue) {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Uint64(final List<RangeConstraint> rangeStatements,\r
- final String units, final BigInteger defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public UnsignedIntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue\r
- * ()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Uint64 other = (Uint64) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Uint64 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
+
+/**
+ * Implementation of Yang uint64 built-in type. <br>
+ * uint64 represents integer values between 0 and 18446744073709551615,
+ * inclusively. The Java counterpart of Yang uint64 built-in type is
+ * {@link BigInteger}.
+ *
+ */
+public class Uint64 extends AbstractUnsignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("uint64");
+ private BigInteger defaultValue = null;
+ private static final String description =
+ "uint64 represents integer values between 0 and 18446744073709551615, inclusively.";
+
+ public Uint64() {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ }
+
+ public Uint64(final BigInteger defaultValue) {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Uint64(final List<RangeConstraint> rangeStatements,
+ final String units, final BigInteger defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public UnsignedIntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
+ * ()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Uint64 other = (Uint64) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Uint64 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-/**\r
- * Implementation of Yang uint8 built-in type.\r
- * <br>\r
- * uint8 represents integer values between 0 and 255, inclusively. The Java counterpart of \r
- * Yang uint8 built-in type is {@link Short}.\r
- * \r
- * @see AbstractUnsignedInteger\r
- */\r
-public class Uint8 extends AbstractUnsignedInteger {\r
-\r
- private static final QName name = BaseTypes.constructQName("uint8");\r
- private Short defaultValue = null;\r
- private static final String description = \r
- "uint8 represents integer values between 0 and 255, inclusively.";\r
-\r
- public Uint8() {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- }\r
-\r
- public Uint8(final Short defaultValue) {\r
- super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Uint8(final List<RangeConstraint> rangeStatements,\r
- final String units, final Short defaultValue) {\r
- super(name, description, rangeStatements, units);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public UnsignedIntegerTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- * \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = super.hashCode();\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (!super.equals(obj)) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- Uint8 other = (Uint8) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder = new StringBuilder();\r
- builder.append("Uint8 [defaultValue=");\r
- builder.append(defaultValue);\r
- builder.append(", AbstractInteger=");\r
- builder.append(super.toString());\r
- builder.append("]");\r
- return builder.toString();\r
- }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
+
+/**
+ * Implementation of Yang uint8 built-in type.
+ * <br>
+ * uint8 represents integer values between 0 and 255, inclusively. The Java counterpart of
+ * Yang uint8 built-in type is {@link Short}.
+ *
+ * @see AbstractUnsignedInteger
+ */
+public class Uint8 extends AbstractUnsignedInteger {
+
+ private static final QName name = BaseTypes.constructQName("uint8");
+ private Short defaultValue = null;
+ private static final String description =
+ "uint8 represents integer values between 0 and 255, inclusively.";
+
+ public Uint8() {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ }
+
+ public Uint8(final Short defaultValue) {
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+ this.defaultValue = defaultValue;
+ }
+
+ public Uint8(final List<RangeConstraint> rangeStatements,
+ final String units, final Short defaultValue) {
+ super(name, description, rangeStatements, units);
+ this.defaultValue = defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public UnsignedIntegerTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Uint8 other = (Uint8) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Uint8 [defaultValue=");
+ builder.append(defaultValue);
+ builder.append(", AbstractInteger=");
+ builder.append(super.toString());
+ builder.append("]");
+ return builder.toString();
+ }
+}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.model.util;
+package org.opendaylight.controller.yang.model.util;
import java.util.Collections;
import java.util.List;
-import org.opendaylight.controller.model.api.type.UnionTypeDefinition;
import org.opendaylight.controller.yang.common.QName;
import org.opendaylight.controller.yang.model.api.SchemaPath;
import org.opendaylight.controller.yang.model.api.Status;
import org.opendaylight.controller.yang.model.api.TypeDefinition;
import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.UnionTypeDefinition;
public class UnionType implements UnionTypeDefinition {
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.model.api.type.LengthConstraint;\r
-import org.opendaylight.controller.model.api.type.PatternConstraint;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.model.api.type.UnknownTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.SchemaPath;\r
-import org.opendaylight.controller.yang.model.api.Status;\r
-import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
-\r
-public class UnknownType implements UnknownTypeDefinition {\r
-\r
- private final QName name;\r
- private final SchemaPath path;\r
- private final String description;\r
- private final String reference;\r
-\r
- private final List<LengthConstraint> lengthStatements;\r
- private final List<PatternConstraint> patterns;\r
- private final List<RangeConstraint> rangeStatements;\r
- private final List<UnknownSchemaNode> extensions;\r
- private final LengthConstraint lengthConstraint;\r
- private final Integer fractionDigits;\r
-\r
- private final Status status;\r
- private final String units;\r
- private final Object defaultValue;\r
-\r
- public static class Builder {\r
-\r
- private final QName name;\r
- private final SchemaPath path;\r
- private String description;\r
- private String reference;\r
-\r
- private List<LengthConstraint> lengthStatements = Collections\r
- .emptyList();\r
- private List<PatternConstraint> patterns = Collections.emptyList();\r
- private List<RangeConstraint> rangeStatements = Collections.emptyList();\r
- private List<UnknownSchemaNode> extensions = Collections.emptyList();\r
- private LengthConstraint lengthConstraint = null;\r
- private Integer fractionDigits = null;\r
-\r
- private Status status = Status.CURRENT;\r
- private String units = "";\r
- private Object defaultValue = null;\r
-\r
- public Builder(final QName name, final String description,\r
- final String reference) {\r
- this.name = name;\r
- this.path = BaseTypes.schemaPath(name);\r
- this.description = description;\r
- this.reference = reference;\r
- }\r
-\r
- public Builder(final QName name) {\r
- this.name = name;\r
- this.path = BaseTypes.schemaPath(name);\r
- }\r
-\r
- public Builder description(String description) {\r
- this.description = description;\r
- return this;\r
- }\r
-\r
- public Builder reference(String reference) {\r
- this.reference = reference;\r
- return this;\r
- }\r
-\r
- public Builder lengthStatements(\r
- final List<LengthConstraint> lengthStatements) {\r
- this.lengthStatements = lengthStatements;\r
- return this;\r
- }\r
-\r
- public Builder patterns(final List<PatternConstraint> patterns) {\r
- this.patterns = patterns;\r
- return this;\r
- }\r
-\r
- public Builder rangeStatements(\r
- final List<RangeConstraint> rangeStatements) {\r
- this.rangeStatements = rangeStatements;\r
- return this;\r
- }\r
-\r
- public Builder extensions(final List<UnknownSchemaNode> extensions) {\r
- this.extensions = extensions;\r
- return this;\r
- }\r
-\r
- public Builder lengthConstraint(final LengthConstraint lengthConstraint) {\r
- this.lengthConstraint = lengthConstraint;\r
- return this;\r
- }\r
-\r
- public Builder fractionDigits(final Integer fractionDigits) {\r
- this.fractionDigits = fractionDigits;\r
- return this;\r
- }\r
-\r
- public Builder status(Status status) {\r
- this.status = status;\r
- return this;\r
- }\r
-\r
- public Builder units(String units) {\r
- this.units = units;\r
- return this;\r
- }\r
-\r
- public Builder defaultValue(final Object defaultValue) {\r
- this.defaultValue = defaultValue;\r
- return this;\r
- }\r
-\r
- public UnknownTypeDefinition build() {\r
- return new UnknownType(this);\r
- }\r
- }\r
-\r
- private UnknownType(Builder builder) {\r
- this.name = builder.name;\r
- this.path = builder.path;\r
- this.description = builder.description;\r
- this.reference = builder.reference;\r
- this.lengthStatements = builder.lengthStatements;\r
- this.patterns = builder.patterns;\r
- this.rangeStatements = builder.rangeStatements;\r
- this.extensions = builder.extensions;\r
- this.lengthConstraint = builder.lengthConstraint;\r
- this.status = builder.status;\r
- this.units = builder.units;\r
- this.defaultValue = builder.defaultValue;\r
- this.fractionDigits = builder.fractionDigits;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
- */\r
- @Override\r
- public UnknownTypeDefinition getBaseType() {\r
- return this;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
- */\r
- @Override\r
- public String getUnits() {\r
- return units;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue\r
- * ()\r
- */\r
- @Override\r
- public Object getDefaultValue() {\r
- return defaultValue;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
- */\r
- @Override\r
- public QName getQName() {\r
- return name;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
- */\r
- @Override\r
- public SchemaPath getPath() {\r
- return path;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
- */\r
- @Override\r
- public String getDescription() {\r
- return description;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
- */\r
- @Override\r
- public String getReference() {\r
- return reference;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
- */\r
- @Override\r
- public Status getStatus() {\r
- return status;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes\r
- * ()\r
- */\r
- @Override\r
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
- return extensions;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition\r
- * #getRangeStatements()\r
- */\r
- @Override\r
- public List<RangeConstraint> getRangeStatements() {\r
- return rangeStatements;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition\r
- * #getLengthStatements()\r
- */\r
- @Override\r
- public List<LengthConstraint> getLengthStatements() {\r
- return lengthStatements;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition\r
- * #getPatterns()\r
- */\r
- @Override\r
- public List<PatternConstraint> getPatterns() {\r
- return patterns;\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition\r
- * #getLengthConstraint()\r
- */\r
- @Override\r
- public LengthConstraint getLengthConstraint() {\r
- return lengthConstraint;\r
- }\r
-\r
- @Override\r
- public Integer getFractionDigits() {\r
- return fractionDigits;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result\r
- + ((defaultValue == null) ? 0 : defaultValue.hashCode());\r
- result = prime * result\r
- + ((description == null) ? 0 : description.hashCode());\r
- result = prime * result\r
- + ((extensions == null) ? 0 : extensions.hashCode());\r
- result = prime\r
- * result\r
- + ((lengthConstraint == null) ? 0 : lengthConstraint.hashCode());\r
- result = prime\r
- * result\r
- + ((lengthStatements == null) ? 0 : lengthStatements.hashCode());\r
- result = prime * result + ((name == null) ? 0 : name.hashCode());\r
- result = prime * result + ((path == null) ? 0 : path.hashCode());\r
- result = prime * result\r
- + ((patterns == null) ? 0 : patterns.hashCode());\r
- result = prime * result\r
- + ((rangeStatements == null) ? 0 : rangeStatements.hashCode());\r
- result = prime * result\r
- + ((reference == null) ? 0 : reference.hashCode());\r
- result = prime * result + ((status == null) ? 0 : status.hashCode());\r
- result = prime * result + ((units == null) ? 0 : units.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj) {\r
- return true;\r
- }\r
- if (obj == null) {\r
- return false;\r
- }\r
- if (getClass() != obj.getClass()) {\r
- return false;\r
- }\r
- UnknownType other = (UnknownType) obj;\r
- if (defaultValue == null) {\r
- if (other.defaultValue != null) {\r
- return false;\r
- }\r
- } else if (!defaultValue.equals(other.defaultValue)) {\r
- return false;\r
- }\r
- if (description == null) {\r
- if (other.description != null) {\r
- return false;\r
- }\r
- } else if (!description.equals(other.description)) {\r
- return false;\r
- }\r
- if (extensions == null) {\r
- if (other.extensions != null) {\r
- return false;\r
- }\r
- } else if (!extensions.equals(other.extensions)) {\r
- return false;\r
- }\r
- if (lengthConstraint == null) {\r
- if (other.lengthConstraint != null) {\r
- return false;\r
- }\r
- } else if (!lengthConstraint.equals(other.lengthConstraint)) {\r
- return false;\r
- }\r
- if (lengthStatements == null) {\r
- if (other.lengthStatements != null) {\r
- return false;\r
- }\r
- } else if (!lengthStatements.equals(other.lengthStatements)) {\r
- return false;\r
- }\r
- if (name == null) {\r
- if (other.name != null) {\r
- return false;\r
- }\r
- } else if (!name.equals(other.name)) {\r
- return false;\r
- }\r
- if (path == null) {\r
- if (other.path != null) {\r
- return false;\r
- }\r
- } else if (!path.equals(other.path)) {\r
- return false;\r
- }\r
- if (patterns == null) {\r
- if (other.patterns != null) {\r
- return false;\r
- }\r
- } else if (!patterns.equals(other.patterns)) {\r
- return false;\r
- }\r
- if (rangeStatements == null) {\r
- if (other.rangeStatements != null) {\r
- return false;\r
- }\r
- } else if (!rangeStatements.equals(other.rangeStatements)) {\r
- return false;\r
- }\r
- if (reference == null) {\r
- if (other.reference != null) {\r
- return false;\r
- }\r
- } else if (!reference.equals(other.reference)) {\r
- return false;\r
- }\r
- if (status != other.status) {\r
- return false;\r
- }\r
- if (units == null) {\r
- if (other.units != null) {\r
- return false;\r
- }\r
- } else if (!units.equals(other.units)) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuilder builder2 = new StringBuilder();\r
- builder2.append("UnknownType [name=");\r
- builder2.append(name);\r
- builder2.append(", path=");\r
- builder2.append(path);\r
- builder2.append(", description=");\r
- builder2.append(description);\r
- builder2.append(", reference=");\r
- builder2.append(reference);\r
- builder2.append(", lengthStatements=");\r
- builder2.append(lengthStatements);\r
- builder2.append(", patterns=");\r
- builder2.append(patterns);\r
- builder2.append(", rangeStatements=");\r
- builder2.append(rangeStatements);\r
- builder2.append(", extensions=");\r
- builder2.append(extensions);\r
- builder2.append(", lengthConstraint=");\r
- builder2.append(lengthConstraint);\r
- builder2.append(", status=");\r
- builder2.append(status);\r
- builder2.append(", units=");\r
- builder2.append(units);\r
- builder2.append(", defaultValue=");\r
- builder2.append(defaultValue);\r
- builder2.append("]");\r
- return builder2.toString();\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.SchemaPath;
+import org.opendaylight.controller.yang.model.api.Status;
+import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.controller.yang.model.api.type.LengthConstraint;
+import org.opendaylight.controller.yang.model.api.type.PatternConstraint;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition;
+
+public class UnknownType implements UnknownTypeDefinition {
+
+ private final QName name;
+ private final SchemaPath path;
+ private final String description;
+ private final String reference;
+
+ private final List<LengthConstraint> lengthStatements;
+ private final List<PatternConstraint> patterns;
+ private final List<RangeConstraint> rangeStatements;
+ private final List<UnknownSchemaNode> extensions;
+ private final LengthConstraint lengthConstraint;
+ private final Integer fractionDigits;
+
+ private final Status status;
+ private final String units;
+ private final Object defaultValue;
+
+ public static class Builder {
+
+ private final QName name;
+ private final SchemaPath path;
+ private String description;
+ private String reference;
+
+ private List<LengthConstraint> lengthStatements = Collections
+ .emptyList();
+ private List<PatternConstraint> patterns = Collections.emptyList();
+ private List<RangeConstraint> rangeStatements = Collections.emptyList();
+ private List<UnknownSchemaNode> extensions = Collections.emptyList();
+ private LengthConstraint lengthConstraint = null;
+ private Integer fractionDigits = null;
+
+ private Status status = Status.CURRENT;
+ private String units = "";
+ private Object defaultValue = null;
+
+ public Builder(final QName name, final String description,
+ final String reference) {
+ this.name = name;
+ this.path = BaseTypes.schemaPath(name);
+ this.description = description;
+ this.reference = reference;
+ }
+
+ public Builder(final QName name) {
+ this.name = name;
+ this.path = BaseTypes.schemaPath(name);
+ }
+
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ public Builder reference(String reference) {
+ this.reference = reference;
+ return this;
+ }
+
+ public Builder lengthStatements(
+ final List<LengthConstraint> lengthStatements) {
+ this.lengthStatements = lengthStatements;
+ return this;
+ }
+
+ public Builder patterns(final List<PatternConstraint> patterns) {
+ this.patterns = patterns;
+ return this;
+ }
+
+ public Builder rangeStatements(
+ final List<RangeConstraint> rangeStatements) {
+ this.rangeStatements = rangeStatements;
+ return this;
+ }
+
+ public Builder extensions(final List<UnknownSchemaNode> extensions) {
+ this.extensions = extensions;
+ return this;
+ }
+
+ public Builder lengthConstraint(final LengthConstraint lengthConstraint) {
+ this.lengthConstraint = lengthConstraint;
+ return this;
+ }
+
+ public Builder fractionDigits(final Integer fractionDigits) {
+ this.fractionDigits = fractionDigits;
+ return this;
+ }
+
+ public Builder status(Status status) {
+ this.status = status;
+ return this;
+ }
+
+ public Builder units(String units) {
+ this.units = units;
+ return this;
+ }
+
+ public Builder defaultValue(final Object defaultValue) {
+ this.defaultValue = defaultValue;
+ return this;
+ }
+
+ public UnknownTypeDefinition build() {
+ return new UnknownType(this);
+ }
+ }
+
+ private UnknownType(Builder builder) {
+ this.name = builder.name;
+ this.path = builder.path;
+ this.description = builder.description;
+ this.reference = builder.reference;
+ this.lengthStatements = builder.lengthStatements;
+ this.patterns = builder.patterns;
+ this.rangeStatements = builder.rangeStatements;
+ this.extensions = builder.extensions;
+ this.lengthConstraint = builder.lengthConstraint;
+ this.status = builder.status;
+ this.units = builder.units;
+ this.defaultValue = builder.defaultValue;
+ this.fractionDigits = builder.fractionDigits;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
+ */
+ @Override
+ public UnknownTypeDefinition getBaseType() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
+ */
+ @Override
+ public String getUnits() {
+ return units;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
+ * ()
+ */
+ @Override
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
+ */
+ @Override
+ public QName getQName() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
+ */
+ @Override
+ public SchemaPath getPath() {
+ return path;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
+ */
+ @Override
+ public String getReference() {
+ return reference;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
+ */
+ @Override
+ public Status getStatus() {
+ return status;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes
+ * ()
+ */
+ @Override
+ public List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return extensions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition
+ * #getRangeStatements()
+ */
+ @Override
+ public List<RangeConstraint> getRangeStatements() {
+ return rangeStatements;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition
+ * #getLengthStatements()
+ */
+ @Override
+ public List<LengthConstraint> getLengthStatements() {
+ return lengthStatements;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition
+ * #getPatterns()
+ */
+ @Override
+ public List<PatternConstraint> getPatterns() {
+ return patterns;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition
+ * #getLengthConstraint()
+ */
+ @Override
+ public LengthConstraint getLengthConstraint() {
+ return lengthConstraint;
+ }
+
+ @Override
+ public Integer getFractionDigits() {
+ return fractionDigits;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result
+ + ((extensions == null) ? 0 : extensions.hashCode());
+ result = prime
+ * result
+ + ((lengthConstraint == null) ? 0 : lengthConstraint.hashCode());
+ result = prime
+ * result
+ + ((lengthStatements == null) ? 0 : lengthStatements.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result
+ + ((patterns == null) ? 0 : patterns.hashCode());
+ result = prime * result
+ + ((rangeStatements == null) ? 0 : rangeStatements.hashCode());
+ result = prime * result
+ + ((reference == null) ? 0 : reference.hashCode());
+ result = prime * result + ((status == null) ? 0 : status.hashCode());
+ result = prime * result + ((units == null) ? 0 : units.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ UnknownType other = (UnknownType) obj;
+ if (defaultValue == null) {
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (extensions == null) {
+ if (other.extensions != null) {
+ return false;
+ }
+ } else if (!extensions.equals(other.extensions)) {
+ return false;
+ }
+ if (lengthConstraint == null) {
+ if (other.lengthConstraint != null) {
+ return false;
+ }
+ } else if (!lengthConstraint.equals(other.lengthConstraint)) {
+ return false;
+ }
+ if (lengthStatements == null) {
+ if (other.lengthStatements != null) {
+ return false;
+ }
+ } else if (!lengthStatements.equals(other.lengthStatements)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (path == null) {
+ if (other.path != null) {
+ return false;
+ }
+ } else if (!path.equals(other.path)) {
+ return false;
+ }
+ if (patterns == null) {
+ if (other.patterns != null) {
+ return false;
+ }
+ } else if (!patterns.equals(other.patterns)) {
+ return false;
+ }
+ if (rangeStatements == null) {
+ if (other.rangeStatements != null) {
+ return false;
+ }
+ } else if (!rangeStatements.equals(other.rangeStatements)) {
+ return false;
+ }
+ if (reference == null) {
+ if (other.reference != null) {
+ return false;
+ }
+ } else if (!reference.equals(other.reference)) {
+ return false;
+ }
+ if (status != other.status) {
+ return false;
+ }
+ if (units == null) {
+ if (other.units != null) {
+ return false;
+ }
+ } else if (!units.equals(other.units)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder2 = new StringBuilder();
+ builder2.append("UnknownType [name=");
+ builder2.append(name);
+ builder2.append(", path=");
+ builder2.append(path);
+ builder2.append(", description=");
+ builder2.append(description);
+ builder2.append(", reference=");
+ builder2.append(reference);
+ builder2.append(", lengthStatements=");
+ builder2.append(lengthStatements);
+ builder2.append(", patterns=");
+ builder2.append(patterns);
+ builder2.append(", rangeStatements=");
+ builder2.append(rangeStatements);
+ builder2.append(", extensions=");
+ builder2.append(extensions);
+ builder2.append(", lengthConstraint=");
+ builder2.append(lengthConstraint);
+ builder2.append(", status=");
+ builder2.append(status);
+ builder2.append(", units=");
+ builder2.append(units);
+ builder2.append(", defaultValue=");
+ builder2.append(defaultValue);
+ builder2.append("]");
+ return builder2.toString();
+ }
+
+}
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.model.util;\r
-\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
-\r
-import org.opendaylight.controller.model.api.type.BinaryTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.BitsTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.BooleanTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.DecimalTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.RangeConstraint;\r
-import org.opendaylight.controller.model.api.type.StringTypeDefinition;\r
-import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
-\r
-public class YangTypesConverter {\r
-\r
- private static final Map<String, TypeDefinition<? extends TypeDefinition<?>>> baseYangTypeMap = new HashMap<String, TypeDefinition<? extends TypeDefinition<?>>>();\r
- private static final Set<String> baseYangTypes = new HashSet<String>();\r
-\r
- private static final TypeDefinition<BinaryTypeDefinition> BINARY = new BinaryType();\r
- private static final TypeDefinition<BitsTypeDefinition> BITS = new BitsType();\r
- private static final TypeDefinition<BooleanTypeDefinition> BOOLEAN_TYPE = new BooleanType();\r
- private static final TypeDefinition<IntegerTypeDefinition> INT8_TYPE = new Int8();\r
- private static final TypeDefinition<IntegerTypeDefinition> INT16_TYPE = new Int16();\r
- private static final TypeDefinition<IntegerTypeDefinition> INT32_TYPE = new Int32();\r
- private static final TypeDefinition<IntegerTypeDefinition> INT64_TYPE = new Int64();\r
- private static final TypeDefinition<StringTypeDefinition> STRING_TYPE = new StringType();\r
- private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT8_TYPE = new Uint8();\r
- private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT16_TYPE = new Uint16();\r
- private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT32_TYPE = new Uint32();\r
- private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT64_TYPE = new Uint64();\r
-\r
- static {\r
- baseYangTypeMap.put("binary", BINARY);\r
- baseYangTypeMap.put("bits", BITS);\r
- baseYangTypeMap.put("boolean", BOOLEAN_TYPE);\r
- baseYangTypeMap.put("int8", INT8_TYPE);\r
- baseYangTypeMap.put("int16", INT16_TYPE);\r
- baseYangTypeMap.put("int32", INT32_TYPE);\r
- baseYangTypeMap.put("int64", INT64_TYPE);\r
- baseYangTypeMap.put("string", STRING_TYPE);\r
- baseYangTypeMap.put("uint8", UINT8_TYPE);\r
- baseYangTypeMap.put("uint16", UINT16_TYPE);\r
- baseYangTypeMap.put("uint32", UINT32_TYPE);\r
- baseYangTypeMap.put("uint64", UINT64_TYPE);\r
-\r
- baseYangTypes.add("binary");\r
- baseYangTypes.add("bits");\r
- baseYangTypes.add("boolean");\r
- baseYangTypes.add("decimal64");\r
- baseYangTypes.add("empty");\r
- baseYangTypes.add("enumeration");\r
- baseYangTypes.add("identityref");\r
- baseYangTypes.add("instance-identifier");\r
- baseYangTypes.add("int8");\r
- baseYangTypes.add("int16");\r
- baseYangTypes.add("int32");\r
- baseYangTypes.add("int64");\r
- baseYangTypes.add("leafref");\r
- baseYangTypes.add("string");\r
- baseYangTypes.add("uint8");\r
- baseYangTypes.add("uint16");\r
- baseYangTypes.add("uint32");\r
- baseYangTypes.add("uint64");\r
- baseYangTypes.add("union");\r
- }\r
-\r
- public static boolean isBaseYangType(String type) {\r
- return baseYangTypes.contains(type);\r
- }\r
-\r
- public static TypeDefinition<?> javaTypeForBaseYangType(QName typeQName) {\r
- TypeDefinition<?> type = baseYangTypeMap.get(typeQName.getLocalName());\r
- return type;\r
- }\r
-\r
- public static TypeDefinition<?> javaTypeForBaseYangType(String typeName) {\r
- TypeDefinition<?> type = baseYangTypeMap.get(typeName);\r
- return type;\r
- }\r
-\r
- public static TypeDefinition<IntegerTypeDefinition> javaTypeForBaseYangSignedIntegerType(\r
- String typeName, List<RangeConstraint> ranges) {\r
- if (typeName.equals("int8")) {\r
- return new Int8(ranges, null, null);\r
- } else if (typeName.equals("int16")) {\r
- return new Int16(ranges, null, null);\r
- } else if (typeName.equals("int32")) {\r
- return new Int32(ranges, null, null);\r
- } else if (typeName.equals("int64")) {\r
- return new Int64(ranges, null, null);\r
- }\r
- return null;\r
- }\r
-\r
- public static TypeDefinition<UnsignedIntegerTypeDefinition> javaTypeForBaseYangUnsignedIntegerType(\r
- final String typeName, List<RangeConstraint> ranges) {\r
- if (typeName.equals("uint8")) {\r
- return new Uint8(ranges, null, null);\r
- } else if (typeName.equals("uint16")) {\r
- return new Uint16(ranges, null, null);\r
- } else if (typeName.equals("uint32")) {\r
- return new Uint32(ranges, null, null);\r
- } else if (typeName.equals("uint64")) {\r
- return new Uint64(ranges, null, null);\r
- }\r
- return null;\r
- }\r
-\r
- public static TypeDefinition<DecimalTypeDefinition> javaTypeForBaseYangDecimal64Type(\r
- List<RangeConstraint> rangeStatements, int fractionDigits) {\r
- return new Decimal64(rangeStatements, fractionDigits);\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.yang.model.util;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.model.api.TypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.BinaryTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.BooleanTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.DecimalTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
+import org.opendaylight.controller.yang.model.api.type.StringTypeDefinition;
+import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
+
+public class YangTypesConverter {
+
+ private static final Map<String, TypeDefinition<? extends TypeDefinition<?>>> baseYangTypeMap = new HashMap<String, TypeDefinition<? extends TypeDefinition<?>>>();
+ private static final Set<String> baseYangTypes = new HashSet<String>();
+
+ private static final TypeDefinition<BinaryTypeDefinition> BINARY = new BinaryType();
+ private static final TypeDefinition<BitsTypeDefinition> BITS = new BitsType();
+ private static final TypeDefinition<BooleanTypeDefinition> BOOLEAN_TYPE = new BooleanType();
+ private static final TypeDefinition<IntegerTypeDefinition> INT8_TYPE = new Int8();
+ private static final TypeDefinition<IntegerTypeDefinition> INT16_TYPE = new Int16();
+ private static final TypeDefinition<IntegerTypeDefinition> INT32_TYPE = new Int32();
+ private static final TypeDefinition<IntegerTypeDefinition> INT64_TYPE = new Int64();
+ private static final TypeDefinition<StringTypeDefinition> STRING_TYPE = new StringType();
+ private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT8_TYPE = new Uint8();
+ private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT16_TYPE = new Uint16();
+ private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT32_TYPE = new Uint32();
+ private static final TypeDefinition<UnsignedIntegerTypeDefinition> UINT64_TYPE = new Uint64();
+
+ static {
+ baseYangTypeMap.put("binary", BINARY);
+ baseYangTypeMap.put("bits", BITS);
+ baseYangTypeMap.put("boolean", BOOLEAN_TYPE);
+ baseYangTypeMap.put("int8", INT8_TYPE);
+ baseYangTypeMap.put("int16", INT16_TYPE);
+ baseYangTypeMap.put("int32", INT32_TYPE);
+ baseYangTypeMap.put("int64", INT64_TYPE);
+ baseYangTypeMap.put("string", STRING_TYPE);
+ baseYangTypeMap.put("uint8", UINT8_TYPE);
+ baseYangTypeMap.put("uint16", UINT16_TYPE);
+ baseYangTypeMap.put("uint32", UINT32_TYPE);
+ baseYangTypeMap.put("uint64", UINT64_TYPE);
+
+ baseYangTypes.add("binary");
+ baseYangTypes.add("bits");
+ baseYangTypes.add("boolean");
+ baseYangTypes.add("decimal64");
+ baseYangTypes.add("empty");
+ baseYangTypes.add("enumeration");
+ baseYangTypes.add("identityref");
+ baseYangTypes.add("instance-identifier");
+ baseYangTypes.add("int8");
+ baseYangTypes.add("int16");
+ baseYangTypes.add("int32");
+ baseYangTypes.add("int64");
+ baseYangTypes.add("leafref");
+ baseYangTypes.add("string");
+ baseYangTypes.add("uint8");
+ baseYangTypes.add("uint16");
+ baseYangTypes.add("uint32");
+ baseYangTypes.add("uint64");
+ baseYangTypes.add("union");
+ }
+
+ public static boolean isBaseYangType(String type) {
+ return baseYangTypes.contains(type);
+ }
+
+ public static TypeDefinition<?> javaTypeForBaseYangType(QName typeQName) {
+ TypeDefinition<?> type = baseYangTypeMap.get(typeQName.getLocalName());
+ return type;
+ }
+
+ public static TypeDefinition<?> javaTypeForBaseYangType(String typeName) {
+ TypeDefinition<?> type = baseYangTypeMap.get(typeName);
+ return type;
+ }
+
+ public static TypeDefinition<IntegerTypeDefinition> javaTypeForBaseYangSignedIntegerType(
+ String typeName, List<RangeConstraint> ranges) {
+ if (typeName.equals("int8")) {
+ return new Int8(ranges, null, null);
+ } else if (typeName.equals("int16")) {
+ return new Int16(ranges, null, null);
+ } else if (typeName.equals("int32")) {
+ return new Int32(ranges, null, null);
+ } else if (typeName.equals("int64")) {
+ return new Int64(ranges, null, null);
+ }
+ return null;
+ }
+
+ public static TypeDefinition<UnsignedIntegerTypeDefinition> javaTypeForBaseYangUnsignedIntegerType(
+ final String typeName, List<RangeConstraint> ranges) {
+ if (typeName.equals("uint8")) {
+ return new Uint8(ranges, null, null);
+ } else if (typeName.equals("uint16")) {
+ return new Uint16(ranges, null, null);
+ } else if (typeName.equals("uint32")) {
+ return new Uint32(ranges, null, null);
+ } else if (typeName.equals("uint64")) {
+ return new Uint64(ranges, null, null);
+ }
+ return null;
+ }
+
+ public static TypeDefinition<DecimalTypeDefinition> javaTypeForBaseYangDecimal64Type(
+ List<RangeConstraint> rangeStatements, int fractionDigits) {
+ return new Decimal64(rangeStatements, fractionDigits);
+ }
+
+}