*
* @see StringTypeDefinition
*/
-public class StringType implements StringTypeDefinition {
-
- private final QName name = BaseTypes.constructQName("string");;
+public final class StringType implements StringTypeDefinition {
+ private final QName name = BaseTypes.constructQName("string");
private final SchemaPath path;
- private String defaultValue = "";
+ private final String defaultValue = "";
private final String description = "";
private final String reference = "";
private final List<LengthConstraint> lengthStatements;
private final List<PatternConstraint> patterns;
- private String units = "";
+ private final String units = "";
+ private final StringTypeDefinition baseType;
/**
* Default Constructor.
*/
- public StringType() {
+ public StringType(final SchemaPath path) {
super();
- path = BaseTypes.schemaPath(name);
+ this.path = path;
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;
+ patterns = Collections.emptyList();
+ baseType = this;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
*/
@Override
public StringTypeDefinition getBaseType() {
- return this;
+ return baseType;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see
* com.csico.yang.model.base.type.api.StringTypeDefinition#getLengthStatements
* ()
/*
* (non-Javadoc)
- *
+ *
* @see
* com.csico.yang.model.base.type.api.StringTypeDefinition#getPatterns()
*/