Package org.drasyl.util
Class UnsignedByte
java.lang.Object
org.drasyl.util.UnsignedByte
This class represents an unsigned short in a rang of [0, 256).
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
short
getValue()
int
hashCode()
static UnsignedByte
of
(byte value) Creates a newUnsignedShort
.static UnsignedByte
of
(short value) Creates a newUnsignedByte
.toString()
-
Field Details
-
MIN_VALUE
-
MAX_VALUE
-
-
Method Details
-
getValue
public short getValue()- Returns:
- the value as short.
-
equals
-
hashCode
public int hashCode() -
toString
-
of
Creates a newUnsignedByte
.- Parameters:
value
- the value as integer- Returns:
- an unsigned byte
- Throws:
IllegalArgumentException
- if the value is not in range of [0, 256).
-
of
Creates a newUnsignedShort
.- Parameters:
value
- the value as byte array in big-endian (BE) format- Returns:
- an unsigned byte
- Throws:
IllegalArgumentException
- if the value is not in range of [0, 256).
-