Class Uint64
java.lang.Object
java.lang.Number
org.opendaylight.yangtools.yang.common.Uint64
- All Implemented Interfaces:
Serializable,Comparable<Uint64>,Immutable,CanonicalValue<Uint64>
Dedicated type for YANG's
type uint64 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 Uint64fromLongBits(long bits) Returns anUint64corresponding to a given bit representation.final inthashCode()final Uint64intern()Return an interned (shared) instance equivalent to this object.final intintValue()final longstatic Uint64saturatedOf(byte byteVal) Returns anUint64corresponding to a givenbyteValif it is representable.static Uint64saturatedOf(int intVal) Returns anUint64corresponding to a givenintValif it is representable.static Uint64saturatedOf(long longVal) Returns anUint64corresponding to a givenlongValif it is representable.static Uint64saturatedOf(short shortVal) Returns anUint32corresponding to a givenshortValif it is representable.static Uint64saturatedOf(BigInteger bigInt) Returns anUint64corresponding to a givenlongValif it is representable.final CanonicalValueSupport<Uint64>support()Return theCanonicalValueassociated with this type.final StringReturn the canonical string representation of this value.final com.google.common.primitives.UnsignedLongtoGuava()Convert this value to anUnsignedLong.final BigIntegertoJava()Convert this value to aBigInteger.final StringtoString()final Uint16toUint16()Convert this value to aUint16.final Uint32toUint32()Convert this value to aUint64.final Uint8toUint8()Convert this value to aUint8.static Uint64valueOf(byte byteVal) Returns anUint64corresponding to a givenbyteVal.static Uint64valueOf(int intVal) Returns anUint64corresponding to a givenintVal.static Uint64valueOf(long longVal) Returns anUint64corresponding to a givenlongVal, which is checked for range.static Uint64valueOf(short shortVal) Returns anUint64corresponding to a givenshortVal.static Uint64valueOf(com.google.common.primitives.UnsignedLong ulong) Returns anUint64corresponding to a givenulong.static Uint64Returns anUint32holding the value of the specifiedString, parsed as an unsignedlongvalue.static Uint64Returns anUint64holding the value of the specifiedString, parsed as an unsignedlongvalue.static Uint64valueOf(BigInteger bigInt) Returns anUint64corresponding to a givenbigInt.static Uint64Returns anUint64corresponding to a givenuint.static Uint64Returns anUint64corresponding to a givenuint.static Uint64Returns anUint64corresponding 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 of18446744073709551615.
-
-
Constructor Details
-
Uint64
-
-
Method Details
-
fromLongBits
Returns anUint64corresponding 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
- Parameters:
byteVal- byte value- Returns:
- A Uint64 instance
- Throws:
IllegalArgumentException- if byteVal is less than zero
-
valueOf
- Parameters:
shortVal- short value- Returns:
- A Uint64 instance
- Throws:
IllegalArgumentException- if shortVal is less than zero
-
valueOf
- Parameters:
intVal- int value- Returns:
- A Uint64 instance
- Throws:
IllegalArgumentException- if intVal is less than zero
-
valueOf
Returns anUint64corresponding 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
Returns anUint64corresponding to a givenuint.- Parameters:
uint- Uint8 value- Returns:
- A Uint64 instance
- Throws:
NullPointerException- if uint is null
-
valueOf
Returns anUint64corresponding to a givenuint.- Parameters:
uint- Uint16 value- Returns:
- A Uint64 instance
- Throws:
NullPointerException- if uint is null
-
valueOf
Returns anUint64corresponding to a givenuint.- Parameters:
uint- Uint32 value- Returns:
- A Uint64 instance
- Throws:
NullPointerException- if uint is null
-
valueOf
Returns anUint64corresponding to a givenulong.- Parameters:
ulong- UnsignedLong value- Returns:
- A Uint64 instance
- Throws:
NullPointerException- if ulong is null
-
valueOf
Returns anUint64corresponding 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
Returns anUint32holding the value of the specifiedString, parsed as an unsignedlongvalue.- 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 unsignedlongvalue.
-
valueOf
Returns anUint64holding the value of the specifiedString, parsed as an unsignedlongvalue.- 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 unsignedlongvalue, or if theradixis outside of allowed range.
-
saturatedOf
Returns anUint64corresponding to a givenbyteValif it is representable. If the value is negativeZEROwill be returned.- Parameters:
byteVal- byte value- Returns:
- A Uint64 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 anUint64corresponding to a givenintValif it is representable. If the value is negativeZEROwill be returned.- Parameters:
intVal- int value- Returns:
- A Uint64 instance
-
saturatedOf
Returns anUint64corresponding to a givenlongValif it is representable. If the value is negativeZEROwill be returned.- Parameters:
longVal- long value- Returns:
- A Uint64 instance
-
saturatedOf
Returns anUint64corresponding to a givenlongValif it is representable. If the value is negativeZEROwill be returned. If the value is greater than 18446744073709551615,MAX_VALUEwill be returned.- Parameters:
bigInt- BigInteger value- Returns:
- A Uint64 instance
- Throws:
NullPointerException- if bigInt is null
-
intValue
public final int intValue() -
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:
floatValuein classNumber
-
doubleValue
public final double doubleValue()- Specified by:
doubleValuein classNumber
-
compareTo
- Specified by:
compareToin interfaceComparable<Uint64>
-
toCanonicalString
Description copied from interface:CanonicalValueReturn the canonical string representation of this value.- Specified by:
toCanonicalStringin interfaceCanonicalValue<Uint64>- 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<Uint64>- Returns:
- A
CanonicalValueinstance.
-
intern
Return an interned (shared) instance equivalent to this object. This may return the same object.- Returns:
- A shared instance.
-
toJava
Convert this value to aBigInteger.- Returns:
- A BigInteger instance
-
toGuava
public final com.google.common.primitives.UnsignedLong toGuava()Convert this value to anUnsignedLong.- Returns:
- An UnsignedLong 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.
-
toUint32
Convert this value to aUint64.- Returns:
- A Uint32
- Throws:
IllegalArgumentException- if this value is greater than 4294967295.
-
hashCode
public final int hashCode() -
equals
-
equals
A slightly faster version ofequals(Object).- Parameters:
obj- Uint64 object- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
toString
-