java.lang.Object
java.lang.Number
org.opendaylight.yangtools.yang.common.Uint64
All Implemented Interfaces:
Serializable, Comparable<Uint64>, Immutable, CanonicalValue<Uint64>

@NonNullByDefault public class Uint64 extends Number implements CanonicalValue<Uint64>
Dedicated type for YANG's type uint64 type.
See Also:
  • Field Details

    • ZERO

      public static final Uint64 ZERO
      Value of 0.
    • ONE

      public static final Uint64 ONE
      Value of 1.
    • TWO

      public static final Uint64 TWO
      Value of 2.
    • TEN

      public static final Uint64 TEN
      Value of 10.
    • MAX_VALUE

      public static final Uint64 MAX_VALUE
      Value of 18446744073709551615.
  • Constructor Details

    • Uint64

      protected Uint64(Uint64 other)
  • Method Details

    • fromLongBits

      public static Uint64 fromLongBits(long bits)
      Returns an Uint64 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)
      Returns an Uint64 corresponding to a given byteVal. The inverse operation is Number.byteValue().
      Parameters:
      byteVal - byte value
      Returns:
      A Uint64 instance
      Throws:
      IllegalArgumentException - if byteVal is less than zero
    • valueOf

      public static Uint64 valueOf(short shortVal)
      Returns an Uint64 corresponding to a given shortVal. The inverse operation is Number.shortValue().
      Parameters:
      shortVal - short value
      Returns:
      A Uint64 instance
      Throws:
      IllegalArgumentException - if shortVal is less than zero
    • valueOf

      public static Uint64 valueOf(int intVal)
      Returns an Uint64 corresponding to a given intVal. The inverse operation is intValue().
      Parameters:
      intVal - int value
      Returns:
      A Uint64 instance
      Throws:
      IllegalArgumentException - if intVal is less than zero
    • valueOf

      public static Uint64 valueOf(long longVal)
      Returns an Uint64 corresponding to a given longVal, which is checked for range. See also longValue() and fromLongBits(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 an Uint64 corresponding to a given uint.
      Parameters:
      uint - Uint8 value
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if uint is null
    • valueOf

      public static Uint64 valueOf(Uint16 uint)
      Returns an Uint64 corresponding to a given uint.
      Parameters:
      uint - Uint16 value
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if uint is null
    • valueOf

      public static Uint64 valueOf(Uint32 uint)
      Returns an Uint64 corresponding to a given uint.
      Parameters:
      uint - Uint32 value
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if uint is null
    • valueOf

      public static Uint64 valueOf(UnsignedLong ulong)
      Returns an Uint64 corresponding to a given ulong.
      Parameters:
      ulong - UnsignedLong value
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if ulong is null
    • valueOf

      public static Uint64 valueOf(BigInteger bigInt)
      Returns an Uint64 corresponding to a given bigInt.
      Parameters:
      bigInt - BigInteger value
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if bigInt is null
      IllegalArgumentException - if bigInt is less than zero or greater than 18446744073709551615
    • valueOf

      public static Uint64 valueOf(String string)
      Returns an Uint32 holding the value of the specified String, parsed as an unsigned long value.
      Parameters:
      string - String to parse
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if string is null
      IllegalArgumentException - if the parsed value is less than zero or greater than 18446744073709551615
      NumberFormatException - if the string does not contain a parsable unsigned long value.
    • valueOf

      public static Uint64 valueOf(String string, int radix)
      Returns an Uint64 holding the value of the specified String, parsed as an unsigned long value.
      Parameters:
      string - String to parse
      radix - Radix to use
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if string is null
      IllegalArgumentException - if the parsed value is less than zero or greater than 18446744073709551615
      NumberFormatException - if the string does not contain a parsable unsigned long value, or if the radix is outside of allowed range.
    • saturatedOf

      public static Uint64 saturatedOf(byte byteVal)
      Returns an Uint64 corresponding to a given byteVal if it is representable. If the value is negative ZERO will be returned.
      Parameters:
      byteVal - byte value
      Returns:
      A Uint64 instance
    • saturatedOf

      public static Uint64 saturatedOf(short shortVal)
      Returns an Uint32 corresponding to a given shortVal if it is representable. If the value is negative ZERO will be returned.
      Parameters:
      shortVal - short value
      Returns:
      A Uint32 instance
    • saturatedOf

      public static Uint64 saturatedOf(int intVal)
      Returns an Uint64 corresponding to a given intVal if it is representable. If the value is negative ZERO will be returned.
      Parameters:
      intVal - int value
      Returns:
      A Uint64 instance
    • saturatedOf

      public static Uint64 saturatedOf(long longVal)
      Returns an Uint64 corresponding to a given longVal if it is representable. If the value is negative ZERO will be returned.
      Parameters:
      longVal - long value
      Returns:
      A Uint64 instance
    • saturatedOf

      public static Uint64 saturatedOf(BigInteger bigInt)
      Returns an Uint64 corresponding to a given longVal if it is representable. If the value is negative ZERO will be returned. If the value is greater than 18446744073709551615, MAX_VALUE will be returned.
      Parameters:
      bigInt - BigInteger value
      Returns:
      A Uint64 instance
      Throws:
      NullPointerException - if bigInt is null
    • intValue

      public final int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public final long longValue()

      The inverse operation is fromLongBits(long). In case this value is greater than Long.MAX_VALUE, the returned value will be equal to this - 2^64.

      Specified by:
      longValue in class Number
    • floatValue

      public final float floatValue()
      Specified by:
      floatValue in class Number
    • doubleValue

      public final double doubleValue()
      Specified by:
      doubleValue in class Number
    • compareTo

      public final int compareTo(Uint64 o)
      Specified by:
      compareTo in interface Comparable<Uint64>
    • toCanonicalString

      public final String toCanonicalString()
      Description copied from interface: CanonicalValue
      Return the canonical string representation of this value.
      Specified by:
      toCanonicalString in interface CanonicalValue<Uint64>
      Returns:
      Canonical string
    • support

      public final CanonicalValueSupport<Uint64> support()
      Description copied from interface: CanonicalValue
      Return the CanonicalValue associated with this type. It can be used to create new instances of this representation.
      Specified by:
      support in interface CanonicalValue<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 a BigInteger.
      Returns:
      A BigInteger instance
    • toGuava

      public final UnsignedLong toGuava()
      Convert this value to an UnsignedLong.
      Returns:
      An UnsignedLong instance
    • toUint8

      public final Uint8 toUint8()
      Convert this value to a Uint8.
      Returns:
      A Uint8
      Throws:
      IllegalArgumentException - if this value is greater than 255.
    • toUint16

      public final Uint16 toUint16()
      Convert this value to a Uint16.
      Returns:
      A Uint16
      Throws:
      IllegalArgumentException - if this value is greater than 65535.
    • toUint32

      public final Uint32 toUint32()
      Convert this value to a Uint64.
      Returns:
      A Uint32
      Throws:
      IllegalArgumentException - if this value is greater than 4294967295.
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • equals

      public final boolean equals(@Nullable Uint64 obj)
      A slightly faster version of equals(Object).
      Parameters:
      obj - Uint64 object
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • toString

      public final String toString()
      Overrides:
      toString in class Object