Class Uint32
java.lang.Object
java.lang.Number
org.opendaylight.yangtools.yang.common.Uint32
- All Implemented Interfaces:
Serializable,Comparable<Uint32>,Immutable,CanonicalValue<Uint32>
Dedicated type for YANG's
type uint32 type.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal doublefinal booleanfinal booleanA slightly faster version ofequals(Object).final floatstatic Uint32fromIntBits(int bits) Returns anUint32corresponding to a given bit representation.final inthashCode()final Uint32intern()Return an interned (shared) instance equivalent to this object.final intintValue()final longstatic Uint32saturatedOf(byte byteVal) Returns anUint32corresponding to a givenbyteValif it is representable.static Uint32saturatedOf(int intVal) Returns anUint32corresponding to a givenintValif it is representable.static Uint32saturatedOf(long longVal) Returns anUint32corresponding to a givenlongValif it is representable.static Uint32saturatedOf(short shortVal) Returns anUint32corresponding to a givenshortValif it is representable.final CanonicalValueSupport<Uint32>support()Return theCanonicalValueassociated with this type.final StringReturn the canonical string representation of this value.final com.google.common.primitives.UnsignedIntegertoGuava()Convert this value to anUnsignedInteger.final longtoJava()Convert this value to along.final Uint16final Uint8final StringtoString()final Uint16toUint16()Convert this value to aUint16.final Uint64toUint64()Convert this value to aUint64.final Uint8toUint8()Convert this value to aUint8.static Uint32valueOf(byte byteVal) Returns anUint32corresponding to a givenbyteVal.static Uint32valueOf(int intVal) Returns anUint32corresponding to a givenintVal.static Uint32valueOf(long longVal) Returns anUint32corresponding to a givenlongVal.static Uint32valueOf(short shortVal) Returns anUint32corresponding to a givenshortVal.static Uint32valueOf(com.google.common.primitives.UnsignedInteger uint) Returns anUint32corresponding to a givenuint.static Uint32Returns anUint32holding the value of the specifiedString, parsed as an unsignedlongvalue.static Uint32Returns anUint32holding the value of the specifiedString, parsed as an unsignedlongvalue.static Uint32Returns anUint32corresponding to a givenuint.static Uint32Returns anUint32corresponding to a givenuint.static Uint32Returns anUint32corresponding to a givenuint.Methods inherited from class java.lang.Number
byteValue, shortValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opendaylight.yangtools.yang.common.CanonicalValue
validator
-
Field Details
-
ZERO
Value of0. -
ONE
Value of1. -
TWO
Value of2. -
TEN
Value of10. -
MAX_VALUE
Value of4294967295.
-
-
Constructor Details
-
Uint32
-
-
Method Details
-
fromIntBits
Returns anUint32corresponding to a given bit representation. The argument is interpreted as an unsigned 32-bit value.- Parameters:
bits- unsigned bit representation- Returns:
- A Uint32 instance
-
valueOf
- Parameters:
byteVal- byte value- Returns:
- A Uint32 instance
- Throws:
IllegalArgumentException- if byteVal is less than zero
-
valueOf
- Parameters:
shortVal- short value- Returns:
- A Uint32 instance
- Throws:
IllegalArgumentException- if shortVal is less than zero
-
valueOf
- Parameters:
intVal- int value- Returns:
- A Uint32 instance
- Throws:
IllegalArgumentException- if intVal is less than zero
-
valueOf
- Parameters:
longVal- long value- Returns:
- A Uint8 instance
- Throws:
IllegalArgumentException- if longVal is less than zero or greater than 4294967295
-
valueOf
Returns anUint32corresponding to a givenuint.- Parameters:
uint- Uint8 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException- if uint is null
-
valueOf
Returns anUint32corresponding to a givenuint.- Parameters:
uint- Uint16 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException- if uint is null
-
valueOf
Returns anUint32corresponding to a givenuint.- Parameters:
uint- Uint64 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException- if uint is nullIllegalArgumentException- if uint is greater than 4294967295
-
valueOf
Returns anUint32corresponding to a givenuint.- Parameters:
uint- UnsignedInteger value- Returns:
- A Uint32 instance
- Throws:
NullPointerException- if uint is null
-
valueOf
Returns anUint32holding the value of the specifiedString, parsed as an unsignedlongvalue.- Parameters:
string- String to parse- Returns:
- A Uint32 instance
- Throws:
NullPointerException- if string is nullIllegalArgumentException- if the parsed value is less than zero or greater than 4294967295NumberFormatException- if the string does not contain a parsable unsignedlongvalue.
-
valueOf
Returns anUint32holding the value of the specifiedString, parsed as an unsignedlongvalue.- Parameters:
string- String to parseradix- Radix to use- Returns:
- A Uint32 instance
- Throws:
NullPointerException- if string is nullIllegalArgumentException- if the parsed value is less than zero or greater than 4294967295NumberFormatException- if the string does not contain a parsable unsignedlongvalue, or if theradixis outside of allowed range.
-
saturatedOf
Returns anUint32corresponding to a givenbyteValif it is representable. If the value is negativeZEROwill be returned.- Parameters:
byteVal- byte value- Returns:
- A Uint32 instance
-
saturatedOf
Returns anUint32corresponding to a givenshortValif it is representable. If the value is negativeZEROwill be returned.- Parameters:
shortVal- short value- Returns:
- A Uint32 instance
-
saturatedOf
Returns anUint32corresponding to a givenintValif it is representable. If the value is negativeZEROwill be returned.- Parameters:
intVal- int value- Returns:
- A Uint32 instance
-
saturatedOf
Returns anUint32corresponding to a givenlongValif it is representable. If the value is negativeZEROwill be returned. If the value is greater than 4294967295,MAX_VALUEwill be returned.- Parameters:
longVal- long value- Returns:
- A Uint32 instance
-
intValue
public final int intValue()The inverse operation is
fromIntBits(int). In case this value is greater thanInteger.MAX_VALUE, the returned value will be equal tothis - 2^32. -
longValue
public final long longValue() -
floatValue
public final float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public final double doubleValue()- Specified by:
doubleValuein classNumber
-
compareTo
- Specified by:
compareToin interfaceComparable<Uint32>
-
toCanonicalString
Description copied from interface:CanonicalValueReturn the canonical string representation of this value.- Specified by:
toCanonicalStringin interfaceCanonicalValue<Uint32>- Returns:
- Canonical string
-
support
Description copied from interface:CanonicalValueReturn theCanonicalValueassociated with this type. It can be used to create new instances of this representation.- Specified by:
supportin interfaceCanonicalValue<Uint32>- Returns:
- A
CanonicalValueinstance.
-
intern
Return an interned (shared) instance equivalent to this object. This may return the same object.- Returns:
- A shared instance.
-
toJava
public final long toJava()Convert this value to along.- Returns:
- A long
-
toGuava
public final com.google.common.primitives.UnsignedInteger toGuava()Convert this value to anUnsignedInteger.- Returns:
- An UnsignedInteger instance
-
toUint8
Convert this value to aUint8.- Returns:
- A Uint8
- Throws:
IllegalArgumentException- if this value is greater than 255.
-
toUint16
Convert this value to aUint16.- Returns:
- A Uint16
- Throws:
IllegalArgumentException- if this value is greater than 65535.
-
toUint64
Convert this value to aUint64.- Returns:
- A Uint64
-
toSaturatedUint8
-
toSaturatedUint16
-
hashCode
public final int hashCode() -
equals
-
equals
A slightly faster version ofequals(Object).- Parameters:
obj- Uint32 object- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
toString
-