Class Uint64
- java.lang.Object
-
- java.lang.Number
-
- org.opendaylight.yangtools.yang.common.Uint64
-
- All Implemented Interfaces:
Serializable
,Comparable<Uint64>
,Immutable
,MutationBehaviour<Immutable>
,CanonicalValue<Uint64>
@Beta @NonNullByDefault public class Uint64 extends Number implements CanonicalValue<Uint64>
Dedicated type for YANG's 'type uint64' type.- Author:
- Robert Varga
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Uint64.Support
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Uint64 o)
double
doubleValue()
boolean
equals(@Nullable Object obj)
boolean
equals(@Nullable Uint64 obj)
A slightly faster version ofequals(Object)
.float
floatValue()
static Uint64
fromLongBits(long bits)
Returns anUint64
corresponding to a given bit representation.int
hashCode()
Uint64
intern()
Return an interned (shared) instance equivalent to this object.int
intValue()
long
longValue()
CanonicalValueSupport<Uint64>
support()
Return theCanonicalValue
associated with this type.String
toCanonicalString()
Return the canonical string representation of this value.UnsignedLong
toGuava()
Convert this value to anUnsignedLong
.BigInteger
toJava()
Convert this value to aBigInteger
.String
toString()
Uint16
toUint16()
Convert this value to aUint16
.Uint32
toUint32()
Convert this value to aUint64
.Uint8
toUint8()
Convert this value to aUint8
.static Uint64
valueOf(byte byteVal)
Returns anUint64
corresponding to a givenbyteVal
.static Uint64
valueOf(int intVal)
Returns anUint64
corresponding to a givenintVal
.static Uint64
valueOf(long longVal)
Returns anUint64
corresponding to a givenlongVal
, which is checked for range.static Uint64
valueOf(short shortVal)
Returns anUint64
corresponding to a givenshortVal
.static Uint64
valueOf(UnsignedLong ulong)
Returns anUint64
corresponding to a givenulong
.static Uint64
valueOf(String string)
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.static Uint64
valueOf(String string, int radix)
Returns anUint64
holding the value of the specifiedString
, parsed as an unsignedlong
value.static Uint64
valueOf(BigInteger bigInt)
Returns anUint64
corresponding to a givenbigInt
.static Uint64
valueOf(Uint16 uint)
Returns anUint64
corresponding to a givenuint
.static Uint64
valueOf(Uint32 uint)
Returns anUint64
corresponding to a givenuint
.static Uint64
valueOf(Uint8 uint)
Returns anUint64
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
-
Uint64
protected Uint64(Uint64 other)
-
-
Method Detail
-
fromLongBits
public static Uint64 fromLongBits(long bits)
Returns anUint64
corresponding to a given bit representation. The argument is interpreted as an unsigned 64-bit value.- Parameters:
bits
- unsigned bit representation- Returns:
- A Uint64 instance
-
valueOf
public static Uint64 valueOf(byte byteVal)
- Parameters:
byteVal
- byte value- Returns:
- A Uint64 instance
- Throws:
IllegalArgumentException
- if byteVal is less than zero
-
valueOf
public static Uint64 valueOf(short shortVal)
- Parameters:
shortVal
- short value- Returns:
- A Uint64 instance
- Throws:
IllegalArgumentException
- if shortVal is less than zero
-
valueOf
public static Uint64 valueOf(int intVal)
- Parameters:
intVal
- int value- Returns:
- A Uint64 instance
- Throws:
IllegalArgumentException
- if intVal is less than zero
-
valueOf
public static Uint64 valueOf(long longVal)
Returns anUint64
corresponding to a givenlongVal
, which is checked for range. See alsolongValue()
andfromLongBits(long)
.- Parameters:
longVal
- long value- Returns:
- A Uint8 instance
- Throws:
IllegalArgumentException
- if longVal is less than zero
-
valueOf
public static Uint64 valueOf(Uint8 uint)
Returns anUint64
corresponding to a givenuint
.- Parameters:
uint
- Uint8 value- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
public static Uint64 valueOf(Uint16 uint)
Returns anUint64
corresponding to a givenuint
.- Parameters:
uint
- Uint16 value- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
public static Uint64 valueOf(Uint32 uint)
Returns anUint64
corresponding to a givenuint
.- Parameters:
uint
- Uint32 value- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if uint is null
-
valueOf
public static Uint64 valueOf(UnsignedLong ulong)
Returns anUint64
corresponding to a givenulong
.- Parameters:
ulong
- UnsignedLong value- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if ulong is null
-
valueOf
public static Uint64 valueOf(BigInteger bigInt)
Returns anUint64
corresponding to a givenbigInt
.- Parameters:
bigInt
- BigInteger value- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if bigInt is nullIllegalArgumentException
- if bigInt is less than zero or greater than 18446744073709551615
-
valueOf
public static Uint64 valueOf(String string)
Returns anUint32
holding the value of the specifiedString
, parsed as an unsignedlong
value.- Parameters:
string
- String to parse- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if string is nullIllegalArgumentException
- if the parsed value is less than zero or greater than 18446744073709551615NumberFormatException
- if the string does not contain a parsable unsignedlong
value.
-
valueOf
public static Uint64 valueOf(String string, int radix)
Returns anUint64
holding the value of the specifiedString
, parsed as an unsignedlong
value.- Parameters:
string
- String to parseradix
- Radix to use- Returns:
- A Uint64 instance
- Throws:
NullPointerException
- if string is nullIllegalArgumentException
- if the parsed value is less than zero or greater than 18446744073709551615NumberFormatException
- if the string does not contain a parsable unsignedlong
value, or if theradix
is outside of allowed range.
-
longValue
public final long longValue()
The inverse operation is
fromLongBits(long)
. In case this value is greater thanLong.MAX_VALUE
, the returned value will be equal tothis - 2^64
.
-
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(Uint64 o)
- Specified by:
compareTo
in interfaceComparable<Uint64>
-
toCanonicalString
public final String toCanonicalString()
Description copied from interface:CanonicalValue
Return the canonical string representation of this value.- Specified by:
toCanonicalString
in interfaceCanonicalValue<Uint64>
- Returns:
- Canonical string
-
support
public final CanonicalValueSupport<Uint64> 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<Uint64>
- Returns:
- A
CanonicalValue
instance.
-
intern
public final Uint64 intern()
Return an interned (shared) instance equivalent to this object. This may return the same object.- Returns:
- A shared instance.
-
toJava
public final BigInteger toJava()
Convert this value to aBigInteger
.- Returns:
- A BigInteger instance
-
toGuava
public final UnsignedLong toGuava()
Convert this value to anUnsignedLong
.- Returns:
- An UnsignedLong 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.
-
toUint32
public final Uint32 toUint32()
Convert this value to aUint64
.- Returns:
- A Uint32
- Throws:
IllegalArgumentException
- if this value is greater than 4294967295.
-
equals
public final boolean equals(@Nullable Uint64 obj)
A slightly faster version ofequals(Object)
.- Parameters:
obj
- Uint64 object- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
-