public class YangBaseString
extends java.lang.Object
White space collapse and replace methods, regexp pattern matchers, and length assertion methods are provided.
| Modifier and Type | Field and Description |
|---|---|
protected T |
value
The value of this object, of which this class is a wrapper for.
|
| Constructor and Description |
|---|
YangBaseString(java.lang.String value)
Creates a YangBaseString object from a java.lang.String.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canEqual(java.lang.Object obj)
Compares type of obj with this object to see if they can be equal.
|
void |
check()
Checks that the value of this object is not null.
|
com.tailf.jnc.YangBaseType<T> |
clone()
Clones this object and its value.
|
protected YangBaseString |
cloneShallow()
Clones this object without cloning its value.
|
boolean |
equals(java.lang.Object obj)
Compares this object with another object for equality.
|
protected void |
exact(int length)
Checks that the value of this object has the specified length.
|
protected java.lang.String |
fromString(java.lang.String s)
Identity method provided because this class extends the YangBaseType
class.
|
T |
getValue() |
int |
hashCode() |
protected void |
max(int length)
Checks that the value of this object has at most the specified length.
|
protected void |
min(int length)
Checks that the value of this object has at least the specified length.
|
protected void |
pattern(java.lang.String regex)
Checks that a regular expression matches the value of this object.
|
protected void |
pattern(java.lang.String[] regexes)
Checks that a set of regular expressions match the value of this object.
|
void |
setValue(java.lang.String value)
Sets the value of this object using a java.lang.String.
|
java.lang.String |
toString() |
protected void |
wsCollapse()
Whitespace replace.
|
protected void |
wsReplace()
Whitespace replace.
|
protected T value
public YangBaseString(java.lang.String value)
throws YangException
value - The Java String.YangException - If an invariant was broken during assignment.public void setValue(java.lang.String value)
throws YangException
setValue in interface YangType<java.lang.String>value - The Java String.YangException - If an invariant was broken during assignment.protected java.lang.String fromString(java.lang.String s)
s - A string.public boolean canEqual(java.lang.Object obj)
obj - Object to compare type with.protected YangBaseString cloneShallow() throws YangException
YangExceptionprotected void pattern(java.lang.String regex)
throws YangException
regex - The regular expression.YangException - If regexp has a syntax error or does not match.protected void pattern(java.lang.String[] regexes)
throws YangException
regexes - The regular expressions.YangException - If any regexp in regexes has a syntax error or
does not match.protected void wsReplace()
protected void wsCollapse()
protected void exact(int length)
throws YangException
length - The required length of this valueYangException - If the comparison does not evaluate to true.protected void min(int length)
throws YangException
length - The lower limit of the length of this valueYangException - if value is shorter than length.protected void max(int length)
throws YangException
length - The upper limit of the length of this value.YangException - if value is longer than length.public T getValue()
public void check()
throws YangException
YangTypecheck in interface YangType<T>YangException - If the value of this object is null.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The object to compare with.public int hashCode()
hashCode in class java.lang.Object