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 int
final double
final boolean
final boolean
A slightly faster version ofequals(Object)
.final float
static Uint32
fromIntBits
(int bits) Returns anUint32
corresponding to a given bit representation.final int
hashCode()
final Uint32
intern()
Return an interned (shared) instance equivalent to this object.final int
intValue()
final long
static Uint32
saturatedOf
(byte byteVal) Returns anUint32
corresponding to a givenbyteVal
if it is representable.static Uint32
saturatedOf
(int intVal) Returns anUint32
corresponding to a givenintVal
if it is representable.static Uint32
saturatedOf
(long longVal) Returns anUint32
corresponding to a givenlongVal
if it is representable.static Uint32
saturatedOf
(short shortVal) Returns anUint32
corresponding to a givenshortVal
if it is representable.final CanonicalValueSupport<Uint32>
support()
Return theCanonicalValue
associated with this type.final String
Return the canonical string representation of this value.final UnsignedInteger
toGuava()
Convert this value to anUnsignedInteger
.final long
toJava()
Convert this value to along
.final Uint16
final Uint8
final String
toString()
final Uint16
toUint16()
Convert this value to aUint16
.final Uint64
toUint64()
Convert this value to aUint64
.final Uint8
toUint8()
Convert this value to aUint8
.static Uint32
valueOf
(byte byteVal) Returns anUint32
corresponding to a givenbyteVal
.static Uint32
valueOf
(int intVal) Returns anUint32
corresponding to a givenintVal
.static Uint32
valueOf
(long longVal) Returns anUint32
corresponding to a givenlongVal
.static Uint32
valueOf
(short shortVal) Returns anUint32
corresponding to a givenshortVal
.static Uint32
valueOf
(UnsignedInteger uint) Returns anUint32
corresponding to a givenuint
.static Uint32
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.static Uint32
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.static Uint32
Returns anUint32
corresponding to a givenuint
.static Uint32
Returns anUint32
corresponding to a givenuint
.static Uint32
Returns anUint32
corresponding to a givenuint
.Methods inherited from class java.lang.Number
byteValue, shortValue
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 anUint32
corresponding 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 anUint32
corresponding to a givenuint
.- Parameters:
uint
- Uint8 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
Returns anUint32
corresponding to a givenuint
.- Parameters:
uint
- Uint16 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
Returns anUint32
corresponding 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 anUint32
corresponding to a givenuint
.- Parameters:
uint
- UnsignedInteger value- Returns:
- A Uint32 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.- 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 unsignedlong
value.
-
valueOf
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.- 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 unsignedlong
value, or if theradix
is outside of allowed range.
-
saturatedOf
Returns anUint32
corresponding to a givenbyteVal
if it is representable. If the value is negativeZERO
will be returned.- Parameters:
byteVal
- byte value- Returns:
- A Uint32 instance
-
saturatedOf
Returns anUint32
corresponding to a givenshortVal
if it is representable. If the value is negativeZERO
will be returned.- Parameters:
shortVal
- short value- Returns:
- A Uint32 instance
-
saturatedOf
Returns anUint32
corresponding to a givenintVal
if it is representable. If the value is negativeZERO
will be returned.- Parameters:
intVal
- int value- Returns:
- A Uint32 instance
-
saturatedOf
Returns anUint32
corresponding to a givenlongVal
if it is representable. If the value is negativeZERO
will be returned. If the value is greater than 4294967295,MAX_VALUE
will 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:
floatValue
in classNumber
-
doubleValue
public final double doubleValue()- Specified by:
doubleValue
in classNumber
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Uint32>
-
toCanonicalString
Description copied from interface:CanonicalValue
Return the canonical string representation of this value.- Specified by:
toCanonicalString
in interfaceCanonicalValue<Uint32>
- Returns:
- Canonical string
-
support
Description copied from interface:CanonicalValue
Return theCanonicalValue
associated with this type. It can be used to create new instances of this representation.- Specified by:
support
in interfaceCanonicalValue<Uint32>
- Returns:
- A
CanonicalValue
instance.
-
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
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:
true
if this object is the same as the obj argument;false
otherwise.
-
toString
-