*/
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;
*
* @see BitsTypeDefinition
*/
-public class BitsType implements BitsTypeDefinition {
-
+public final class BitsType implements BitsTypeDefinition {
private final QName name = BaseTypes.constructQName("bits");
private final SchemaPath path;
private final String description = "The bits built-in type represents a bit set. "
private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.7";
private final BitsTypeDefinition baseType;
private final List<Bit> bits;
- private String units = "";
+ private final String units = "";
/**
* Default constructor. <br>
* Instantiates Bits type as empty bits list.
+ *
+ * @param path
*/
- private BitsType() {
+ public BitsType(final SchemaPath path) {
super();
this.bits = Collections.emptyList();
- this.path = BaseTypes.schemaPath(name);
+ this.path = path;
this.baseType = this;
}
- public BitsType(final List<String> 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.
*
- * @param actualPath
- * @param namespace
- * @param revision
+ * @param path
* @param bits
- * The bits assigned for Bits Type
*/
- public BitsType(final List<String> actualPath, final URI namespace,
- final Date revision, final List<Bit> bits) {
+ public BitsType(final SchemaPath path, final List<Bit> 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. <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(final List<String> actualPath, final URI namespace,
- final Date revision, List<Bit> bits, String units) {
- super();
- this.bits = Collections.unmodifiableList(bits);
- this.units = units;
- this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
- this.baseType = new BitsType();
+ this.path = path;
+ this.baseType = this;
}
/*
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 + ((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 + ((reference == null) ? 0 : reference.hashCode());
result = prime * result + ((units == null) ? 0 : units.hashCode());
return result;
}