public class YangUInt8 extends YangInt16
| Modifier and Type | Field and Description |
|---|---|
protected java.math.BigDecimal |
MAX_VALUE
An upper bound for the value of this object, or null if none.
|
protected java.math.BigDecimal |
MIN_VALUE
A lower bound for the value of this object, or null if none.
|
protected T |
value
The value of this object, of which this class is a wrapper for.
|
| Constructor and Description |
|---|
YangUInt8(java.lang.Number value)
Creates a YangUInt8 object from a Number.
|
YangUInt8(java.lang.String s)
Creates a YangUInt8 object from a 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 and valid.
|
com.tailf.jnc.YangBaseType<T> |
clone()
Clones this object and its value.
|
protected YangUInt8 |
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(java.lang.Number value)
Checks that the value of this object equals another value.
|
protected T |
fromString(java.lang.String s)
Returns a value of type T given a String.
|
T |
getValue() |
int |
hashCode() |
protected void |
max(java.lang.Number max)
Checks that the value of this object is not larger than the max-value.
|
protected void |
min(java.lang.Number min)
Checks that the value of this object is not smaller than the min-value.
|
protected void |
setMinMax(java.lang.Number minValue,
java.lang.Number maxValue)
Sets the MIN_VALUE and MAX_VALUE fields of this object.
|
void |
setValue(java.lang.String s)
Sets the value of this object using a String.
|
void |
setValue(T value)
Sets the value of this object using a value of type T.
|
java.lang.String |
toString() |
protected boolean |
valid(java.lang.Number n) |
protected java.math.BigDecimal MIN_VALUE
protected java.math.BigDecimal MAX_VALUE
protected T value
public YangUInt8(java.lang.String s)
throws YangException
s - The string.YangException - If value could not be parsed from s or if the
parsed value is negative or larger than 0xff.public YangUInt8(java.lang.Number value)
throws YangException
value - The initial value of the new YangUInt8 object.YangException - If value is negative or larger than 0xff.protected YangUInt8 cloneShallow() throws YangException
cloneShallow in class YangInt16YangExceptionprotected void setMinMax(java.lang.Number minValue,
java.lang.Number maxValue)
throws YangException
minValue - value to set MIN_VALUE to.maxValue - value to set MAX_VALUE to.YangException - If minValue is larger than maxValue.protected boolean valid(java.lang.Number n)
n - A number to check for validity.public void check()
throws YangException
YangBaseInt.valid(java.lang.Number) method should
override this method and throw a YangException if such an invariant has
been violated.check in interface YangType<T extends java.lang.Number>YangException - If the value of this object is null or invalid.protected final T fromString(java.lang.String s)
throws YangException
Note: This method is non-static since T is a non-static type.
s - A string representation of a value of type T.YangException - If s does not contain a parsable T.public boolean canEqual(java.lang.Object obj)
If a subclass of this class overrides the equals method, this method should be overridden as well.
obj - Object to compare type with.protected void exact(java.lang.Number value)
throws YangException
value - The value to compare against.YangException - If comparison does not evaluate to true or if the
value argument is not YangBaseInt.valid(java.lang.Number).protected void min(java.lang.Number min)
throws YangException
min - The min-value to compare against.YangException - If value is smaller than min or min is invalid.protected void max(java.lang.Number max)
throws YangException
max - The max-value to compare against.YangException - If value is larger than max or max is invalid.public void setValue(java.lang.String s)
throws YangException
YangTypesetValue in interface YangType<T>s - A string containing the new value to set.YangException - If an invariant was broken during assignment, or
if value could not be parsed from s.public void setValue(T value)
throws YangException
YangTypesetValue in interface YangType<T>value - The new value to set.YangException - If an invariant was broken during assignment.public T getValue()
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