Record Class DoubleValue

java.lang.Object
java.lang.Record
com.github.siroshun09.configapi.core.node.DoubleValue
Record Components:
doubleValue - a double value
All Implemented Interfaces:
Node<Number>, NumberValue, StringRepresentable, ValueNode<Number>, Comparable<NumberValue>

public record DoubleValue(double doubleValue) extends Record implements NumberValue, StringRepresentable
A Node implementation that holds a double value.
  • Constructor Details

    • DoubleValue

      public DoubleValue(double doubleValue)
      Creates an instance of a DoubleValue record class.
      Parameters:
      doubleValue - the value for the doubleValue record component
  • Method Details

    • value

      @NotNull public @NotNull Double value()
      Description copied from interface: Node
      Gets an object which this Node holds
      Specified by:
      value in interface Node<Number>
      Specified by:
      value in interface ValueNode<Number>
      Returns:
      an object which this Node holds
    • asInt

      public int asInt()
      Description copied from interface: NumberValue
      Gets the number as int.
      Specified by:
      asInt in interface NumberValue
      Returns:
      the int value
    • asLong

      public long asLong()
      Description copied from interface: NumberValue
      Gets the number as long.
      Specified by:
      asLong in interface NumberValue
      Returns:
      the long value
    • asFloat

      public float asFloat()
      Description copied from interface: NumberValue
      Gets the number as float.
      Specified by:
      asFloat in interface NumberValue
      Returns:
      the float value
    • asDouble

      public double asDouble()
      Description copied from interface: NumberValue
      Gets the number as double.
      Specified by:
      asDouble in interface NumberValue
      Returns:
      the double value
    • asByte

      public byte asByte()
      Description copied from interface: NumberValue
      Gets the number as byte.
      Specified by:
      asByte in interface NumberValue
      Returns:
      the byte value
    • asShort

      public short asShort()
      Description copied from interface: NumberValue
      Gets the number as short.
      Specified by:
      asShort in interface NumberValue
      Returns:
      the short value
    • compareTo

      public int compareTo(@NotNull @NotNull NumberValue o)
      Specified by:
      compareTo in interface Comparable<NumberValue>
    • accept

      @NotNull public @NotNull VisitResult accept(@NotNull @NotNull NodeVisitor visitor)
      Description copied from interface: Node
      Accepts a NodeVisitor for this Node.
      Specified by:
      accept in interface Node<Number>
      Parameters:
      visitor - a NodeVisitor to accept
      Returns:
      a VisitResult
    • asString

      @NotNull public @NotNull String asString()
      Description copied from interface: StringRepresentable
      Represents as a String.
      Specified by:
      asString in interface StringRepresentable
      Returns:
      a String representation of this node
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • doubleValue

      public double doubleValue()
      Returns the value of the doubleValue record component.
      Returns:
      the value of the doubleValue record component