Class Uint32
- java.lang.Object
-
- java.lang.Number
-
- org.opendaylight.yangtools.yang.common.Uint32
-
- All Implemented Interfaces:
Serializable
,Comparable<Uint32>
,Immutable
,MutationBehaviour<Immutable>
,CanonicalValue<Uint32>
@Beta @NonNullByDefault public class Uint32 extends Number implements CanonicalValue<Uint32>
Dedicated type for YANG's 'type uint32' type.- Author:
- Robert Varga
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Uint32.Support
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Uint32 o)
double
doubleValue()
boolean
equals(@Nullable Object obj)
boolean
equals(@Nullable Uint32 obj)
A slightly faster version ofequals(Object)
.float
floatValue()
static Uint32
fromIntBits(int bits)
Returns anUint32
corresponding to a given bit representation.int
hashCode()
Uint32
intern()
Return an interned (shared) instance equivalent to this object.int
intValue()
long
longValue()
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.CanonicalValueSupport<Uint32>
support()
Return theCanonicalValue
associated with this type.String
toCanonicalString()
Return the canonical string representation of this value.UnsignedInteger
toGuava()
Convert this value to anUnsignedInteger
.long
toJava()
Convert this value to along
.Uint16
toSaturatedUint16()
Uint8
toSaturatedUint8()
String
toString()
Uint16
toUint16()
Convert this value to aUint16
.Uint64
toUint64()
Convert this value to aUint64
.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
valueOf(String string)
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.static Uint32
valueOf(String string, int radix)
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.static Uint32
valueOf(Uint16 uint)
Returns anUint32
corresponding to a givenuint
.static Uint32
valueOf(Uint64 uint)
Returns anUint32
corresponding to a givenuint
.static Uint32
valueOf(Uint8 uint)
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
-
-
-
-
Constructor Detail
-
Uint32
protected Uint32(Uint32 other)
-
-
Method Detail
-
fromIntBits
public static Uint32 fromIntBits(int bits)
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
public static Uint32 valueOf(byte byteVal)
- Parameters:
byteVal
- byte value- Returns:
- A Uint32 instance
- Throws:
IllegalArgumentException
- if byteVal is less than zero
-
valueOf
public static Uint32 valueOf(short shortVal)
- Parameters:
shortVal
- short value- Returns:
- A Uint32 instance
- Throws:
IllegalArgumentException
- if shortVal is less than zero
-
valueOf
public static Uint32 valueOf(int intVal)
- Parameters:
intVal
- int value- Returns:
- A Uint32 instance
- Throws:
IllegalArgumentException
- if intVal is less than zero
-
valueOf
public static Uint32 valueOf(long longVal)
- Parameters:
longVal
- long value- Returns:
- A Uint8 instance
- Throws:
IllegalArgumentException
- if longVal is less than zero or greater than 4294967295
-
valueOf
public static Uint32 valueOf(Uint8 uint)
Returns anUint32
corresponding to a givenuint
.- Parameters:
uint
- Uint8 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
public static Uint32 valueOf(Uint16 uint)
Returns anUint32
corresponding to a givenuint
.- Parameters:
uint
- Uint16 value- Returns:
- A Uint32 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
public static Uint32 valueOf(Uint64 uint)
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
public static Uint32 valueOf(UnsignedInteger uint)
Returns anUint32
corresponding to a givenuint
.- Parameters:
uint
- UnsignedInteger value- Returns:
- A Uint32 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
public static Uint32 valueOf(String string)
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
public static Uint32 valueOf(String string, int radix)
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
public static Uint32 saturatedOf(byte byteVal)
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
public static Uint32 saturatedOf(short shortVal)
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
public static Uint32 saturatedOf(int intVal)
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
public static Uint32 saturatedOf(long longVal)
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
.
-
floatValue
public final float floatValue()
- Specified by:
floatValue
in classNumber
-
doubleValue
public final double doubleValue()
- Specified by:
doubleValue
in classNumber
-
compareTo
public final int compareTo(Uint32 o)
- Specified by:
compareTo
in interfaceComparable<Uint32>
-
toCanonicalString
public final String toCanonicalString()
Description copied from interface:CanonicalValue
Return the canonical string representation of this value.- Specified by:
toCanonicalString
in interfaceCanonicalValue<Uint32>
- Returns:
- Canonical string
-
support
public final CanonicalValueSupport<Uint32> 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
public final Uint32 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 UnsignedInteger toGuava()
Convert this value to anUnsignedInteger
.- Returns:
- An UnsignedInteger instance
-
toUint8
public final Uint8 toUint8()
Convert this value to aUint8
.- Returns:
- A Uint8
- Throws:
IllegalArgumentException
- if this value is greater than 255.
-
toUint16
public final Uint16 toUint16()
Convert this value to aUint16
.- Returns:
- A Uint16
- Throws:
IllegalArgumentException
- if this value is greater than 65535.
-
toUint64
public final Uint64 toUint64()
Convert this value to aUint64
.- Returns:
- A Uint64
-
toSaturatedUint8
public final Uint8 toSaturatedUint8()
-
toSaturatedUint16
public final Uint16 toSaturatedUint16()
-
equals
public final boolean equals(@Nullable Uint32 obj)
A slightly faster version ofequals(Object)
.- Parameters:
obj
- Uint32 object- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
-