com.h3c.util.ip

## Class UnsignedId

- java.lang.Object
- - com.h3c.util.cache.CacheableDataType
  - - com.h3c.util.ip.UnsignedId

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    UnsignedIntBasedId, UnsignedLongBasedId

      public abstract class UnsignedId
      extends CacheableDataType

  Forms the basis of datatype classes represented by unsigned values.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `E_BAD` Error message for bad identifier.
    `protected static String` | `E_NULL_BYTES` Error message when byte array is null.
    `protected static String` | `E_NULL_STR` Error message when String is null.
    `protected static String` | `E_OOR` Error message for out of range number.
    `static int` | `MIN_VALUE` Lowest valid value for an id.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnsignedId()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static int` | `parseIntStr(String s)` Returns the int equivalent to the specified string.
    `protected static long` | `parseLongStr(String s)` Returns the long equivalent to the specified string.

    - ### Methods inherited from class com.h3c.util.cache.CacheableDataType

      `getRefQ, keyFromBytes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### E_BAD

          protected static final String E_BAD

      Error message for bad identifier.
      See Also:
        Constant Field Values

    - #### E_OOR

          protected static final String E_OOR

      Error message for out of range number.
      See Also:
        Constant Field Values

    - #### E_NULL_BYTES

          protected static final String E_NULL_BYTES

      Error message when byte array is null.
      See Also:
        Constant Field Values

    - #### E_NULL_STR

          protected static final String E_NULL_STR

      Error message when String is null.
      See Also:
        Constant Field Values

    - #### MIN_VALUE

          public static final int MIN_VALUE

      Lowest valid value for an id.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UnsignedId

          public UnsignedId()

  - ### Method Detail

    - #### parseIntStr

          protected static int parseIntStr(String s)

      Returns the int equivalent to the specified string. The string is parsed as a base-10 value, unless it has a "0x" prefix, in which case it is parsed as a hex number.
      Parameters:
        `s` - the string
      Returns:
        the equivalent int
      Throws:
        `IllegalArgumentException` - if the string is invalid
        `NullPointerException` - if the string is null

    - #### parseLongStr

          protected static long parseLongStr(String s)

      Returns the long equivalent to the specified string. The string is parsed as a base-10 value, unless it has a "0x" prefix, in which case it is parsed as a hex number.
      Parameters:
        `s` - the string
      Returns:
        the equivalent long
      Throws:
        `IllegalArgumentException` - if the string is invalid
        `NullPointerException` - if the string is null

Copyright © 2014. All Rights Reserved.