Class HopCount
java.lang.Object
org.drasyl.handler.remote.protocol.HopCount
- All Implemented Interfaces:
Comparable<HopCount>
This is an immutable object.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintbooleanbytegetByte()inthashCode()static HopCountof()Creates a new minimal hop count value.static HopCountof(byte value) Creates a new hop count value with given value.static HopCountof(int value) Creates a new hop count value with given value.static HopCountof(short value) Creates a new hop count value with given value.toString()
-
Field Details
-
MIN_HOP_COUNT
public static final byte MIN_HOP_COUNT- See Also:
-
MAX_HOP_COUNT
public static final byte MAX_HOP_COUNT- See Also:
-
-
Method Details
-
getByte
public byte getByte() -
increment
- Throws:
IllegalStateException- if incremented hop count is greater thenMAX_HOP_COUNT
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<HopCount>
-
of
Creates a new hop count value with given value.- Throws:
IllegalArgumentException- ifvalueis smaller thenMIN_HOP_COUNT
-
of
Creates a new hop count value with given value.- Throws:
IllegalArgumentException- ifvalueis not betweenMIN_HOP_COUNTandMAX_HOP_COUNT
-
of
Creates a new hop count value with given value.- Throws:
IllegalArgumentException- ifvalueis not betweenMIN_HOP_COUNTandMAX_HOP_COUNT
-
of
Creates a new minimal hop count value.
-