X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fyang%2Fyang-model-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fyang%2Fmodel%2Futil%2FBitsType.java;h=717c24ed5083c2b89cc47fd0fa9a6b473aaa4d6d;hb=refs%2Fchanges%2F60%2F260%2F2;hp=e6c118934e72ef78f9e958b21765f36a56fe5720;hpb=184e4f61d034f6c83da75de288d4f56ec48f60bf;p=controller.git diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BitsType.java b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BitsType.java index e6c118934e..717c24ed50 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BitsType.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BitsType.java @@ -1,13 +1,15 @@ /* - * 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 - */ + * 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.Collections; +import java.util.Date; import java.util.List; import org.opendaylight.controller.yang.common.QName; @@ -16,22 +18,21 @@ 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 default 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 SchemaPath path; + 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 BitsTypeDefinition baseType; private final List bits; private String units = ""; @@ -39,52 +40,72 @@ public class BitsType implements BitsTypeDefinition { * Default constructor.
* Instantiates Bits type as empty bits list. */ - public BitsType() { + private BitsType() { super(); - bits = Collections.emptyList(); + this.bits = Collections.emptyList(); + this.path = BaseTypes.schemaPath(name); + this.baseType = this; + } + + public BitsType(final List actualPath, final URI namespace, + final Date revision) { + super(); + this.bits = Collections.emptyList(); + this.path = BaseTypes.schemaPath(actualPath, namespace, revision); + this.baseType = new BitsType(); } /** - * Constructor with explicit definition of bits assigned to - * BitsType. - * + * Constructor with explicit definition of bits assigned to BitsType. + * + * @param actualPath + * @param namespace + * @param revision * @param bits * The bits assigned for Bits Type */ - public BitsType(final List bits) { + public BitsType(final List actualPath, final URI namespace, + final Date revision, final List bits) { super(); this.bits = Collections.unmodifiableList(bits); this.units = ""; + this.path = BaseTypes.schemaPath(actualPath, namespace, revision); + this.baseType = new BitsType(); } /** - * Constructor with explicit definition of bits assigned to - * BitsType and Units. - *
+ * Constructor with explicit definition of bits assigned to BitsType and + * Units.
* The default value of Bits Type is List of bits. - * - * @param bits The bits assigned for Bits Type - * @param units units for bits type + * + * @param bits + * The bits assigned for Bits Type + * @param units + * units for bits type */ - public BitsType(List bits, String units) { + public BitsType(final List actualPath, final URI namespace, + final Date revision, List bits, String units) { super(); this.bits = Collections.unmodifiableList(bits); this.units = units; + this.path = BaseTypes.schemaPath(actualPath, namespace, revision); + this.baseType = new BitsType(); } /* * (non-Javadoc) - * - * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType() + * + * @see + * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType() */ @Override public BitsTypeDefinition getBaseType() { - return this; + return baseType; } /* * (non-Javadoc) - * + * * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits() */ @Override @@ -94,8 +115,10 @@ public class BitsType implements BitsTypeDefinition { /* * (non-Javadoc) - * - * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue() + * + * @see + * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue + * () */ @Override public Object getDefaultValue() { @@ -104,7 +127,7 @@ public class BitsType implements BitsTypeDefinition { /* * (non-Javadoc) - * + * * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName() */ @Override @@ -114,7 +137,7 @@ public class BitsType implements BitsTypeDefinition { /* * (non-Javadoc) - * + * * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath() */ @Override @@ -124,8 +147,9 @@ public class BitsType implements BitsTypeDefinition { /* * (non-Javadoc) - * - * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription() + * + * @see + * org.opendaylight.controller.yang.model.api.SchemaNode#getDescription() */ @Override public String getDescription() { @@ -134,7 +158,7 @@ public class BitsType implements BitsTypeDefinition { /* * (non-Javadoc) - * + * * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference() */ @Override @@ -144,7 +168,7 @@ public class BitsType implements BitsTypeDefinition { /* * (non-Javadoc) - * + * * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus() */ @Override