Record Class LongValue
java.lang.Object
java.lang.Record
com.github.siroshun09.configapi.core.node.LongValue
- Record Components:
longValue- a long value
- All Implemented Interfaces:
Node<Number>,NumberValue,StringRepresentable,ValueNode<Number>,Comparable<NumberValue>
A
Node implementation that holds a long value.-
Field Summary
Fields inherited from interface com.github.siroshun09.configapi.core.node.NumberValue
ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull VisitResultaccept(@NotNull NodeVisitor visitor) Accepts aNodeVisitorfor thisNode.byteasByte()Gets the number as byte.doubleasDouble()Gets the number as double.floatasFloat()Gets the number as float.intasInt()Gets the number as int.longasLong()Gets the number as long.shortasShort()Gets the number as short.@NotNull StringasString()Represents as aString.intcompareTo(@NotNull NumberValue o) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thelongValuerecord component.final StringtoString()Returns a string representation of this record class.@NotNull Longvalue()Gets an object which thisNodeholdsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.siroshun09.configapi.core.node.Node
asOptionalMethods inherited from interface com.github.siroshun09.configapi.core.node.NumberValue
hasValue
-
Constructor Details
-
LongValue
public LongValue(long longValue) Creates an instance of aLongValuerecord class.- Parameters:
longValue- the value for thelongValuerecord component
-
-
Method Details
-
value
Description copied from interface:NodeGets an object which thisNodeholds -
asInt
public int asInt()Description copied from interface:NumberValueGets the number as int.- Specified by:
asIntin interfaceNumberValue- Returns:
- the int value
-
asLong
public long asLong()Description copied from interface:NumberValueGets the number as long.- Specified by:
asLongin interfaceNumberValue- Returns:
- the long value
-
asFloat
public float asFloat()Description copied from interface:NumberValueGets the number as float.- Specified by:
asFloatin interfaceNumberValue- Returns:
- the float value
-
asDouble
public double asDouble()Description copied from interface:NumberValueGets the number as double.- Specified by:
asDoublein interfaceNumberValue- Returns:
- the double value
-
asByte
public byte asByte()Description copied from interface:NumberValueGets the number as byte.- Specified by:
asBytein interfaceNumberValue- Returns:
- the byte value
-
asShort
public short asShort()Description copied from interface:NumberValueGets the number as short.- Specified by:
asShortin interfaceNumberValue- Returns:
- the short value
-
compareTo
- Specified by:
compareToin interfaceComparable<NumberValue>
-
accept
Description copied from interface:NodeAccepts aNodeVisitorfor thisNode.- Specified by:
acceptin interfaceNode<Number>- Parameters:
visitor- aNodeVisitorto accept- Returns:
- a
VisitResult
-
asString
Description copied from interface:StringRepresentableRepresents as aString.- Specified by:
asStringin interfaceStringRepresentable- Returns:
- a
Stringrepresentation 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 '=='. -
longValue
public long longValue()Returns the value of thelongValuerecord component.- Returns:
- the value of the
longValuerecord component
-