Record Class ByteValue
java.lang.Object
java.lang.Record
com.github.siroshun09.configapi.core.node.ByteValue
- Record Components:
byteValue
- a byte value
- All Implemented Interfaces:
Node<Number>
,NumberValue
,StringRepresentable
,ValueNode<Number>
,Comparable<NumberValue>
A
Node
implementation that holds a byte value.-
Field Summary
Fields inherited from interface com.github.siroshun09.configapi.core.node.NumberValue
ZERO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull VisitResult
accept
(@NotNull NodeVisitor visitor) Accepts aNodeVisitor
for thisNode
.byte
asByte()
Gets the number as byte.double
asDouble()
Gets the number as double.float
asFloat()
Gets the number as float.int
asInt()
Gets the number as int.long
asLong()
Gets the number as long.short
asShort()
Gets the number as short.@NotNull String
asString()
Represents as aString
.byte
Returns the value of thebyteValue
record component.int
compareTo
(@NotNull NumberValue o) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.@NotNull Byte
value()
Gets an object which thisNode
holdsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.siroshun09.configapi.core.node.Node
asOptional
Methods inherited from interface com.github.siroshun09.configapi.core.node.NumberValue
hasValue
-
Constructor Details
-
ByteValue
public ByteValue(byte byteValue) Creates an instance of aByteValue
record class.- Parameters:
byteValue
- the value for thebyteValue
record component
-
-
Method Details
-
value
Description copied from interface:Node
Gets an object which thisNode
holds -
asInt
public int asInt()Description copied from interface:NumberValue
Gets the number as int.- Specified by:
asInt
in interfaceNumberValue
- Returns:
- the int value
-
asLong
public long asLong()Description copied from interface:NumberValue
Gets the number as long.- Specified by:
asLong
in interfaceNumberValue
- Returns:
- the long value
-
asFloat
public float asFloat()Description copied from interface:NumberValue
Gets the number as float.- Specified by:
asFloat
in interfaceNumberValue
- Returns:
- the float value
-
asDouble
public double asDouble()Description copied from interface:NumberValue
Gets the number as double.- Specified by:
asDouble
in interfaceNumberValue
- Returns:
- the double value
-
asByte
public byte asByte()Description copied from interface:NumberValue
Gets the number as byte.- Specified by:
asByte
in interfaceNumberValue
- Returns:
- the byte value
-
asShort
public short asShort()Description copied from interface:NumberValue
Gets the number as short.- Specified by:
asShort
in interfaceNumberValue
- Returns:
- the short value
-
compareTo
- Specified by:
compareTo
in interfaceComparable<NumberValue>
-
accept
Description copied from interface:Node
Accepts aNodeVisitor
for thisNode
.- Specified by:
accept
in interfaceNode<Number>
- Parameters:
visitor
- aNodeVisitor
to accept- Returns:
- a
VisitResult
-
asString
Description copied from interface:StringRepresentable
Represents as aString
.- Specified by:
asString
in interfaceStringRepresentable
- Returns:
- a
String
representation of this node
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
byteValue
public byte byteValue()Returns the value of thebyteValue
record component.- Returns:
- the value of the
byteValue
record component
-