Record Class StringReader.ParsedNumber

java.lang.Object
java.lang.Record
net.luis.utils.io.reader.StringReader.ParsedNumber
Record Components:
sign - The sign of the number
value - The value of the number
type - The type of the number
radix - The radix of the number
Enclosing class:
StringReader

private static record StringReader.ParsedNumber(char sign, @NotNull String value, @NotNull NumberType type, @NotNull Radix radix) extends Record
Internal to represent a parsed number.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final @NotNull Radix
    The field for the radix record component.
    private final char
    The field for the sign record component.
    private final @NotNull NumberType
    The field for the type record component.
    private final @NotNull String
    The field for the value record component.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    ParsedNumber(char sign, @NotNull String value, @NotNull NumberType type, @NotNull Radix radix)
    Constructs a new parsed number.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull String
    Returns the signed value of the number.
    The value is prefixed with the sign.
    final int
    Returns a hash code value for this object.
    @NotNull Radix
    Returns the value of the radix record component.
    char
    Returns the value of the sign record component.
    @NotNull String
    Returns a string representation of this record class.
    @NotNull NumberType
    Returns the value of the type record component.
    @NotNull String
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • sign

      private final char sign
      The field for the sign record component.
    • value

      @NotNull private final @NotNull String value
      The field for the value record component.
    • type

      @NotNull private final @NotNull NumberType type
      The field for the type record component.
    • radix

      @NotNull private final @NotNull Radix radix
      The field for the radix record component.
  • Constructor Details

    • ParsedNumber

      private ParsedNumber(char sign, @NotNull @NotNull String value, @NotNull @NotNull NumberType type, @NotNull @NotNull Radix radix)
      Constructs a new parsed number.
      Parameters:
      sign - The sign of the number
      value - The value of the number
      type - The type of the number
      radix - The radix of the number
      Throws:
      NullPointerException - If the value, type or radix is null
  • Method Details

    • getSignedValue

      @NotNull public @NotNull String getSignedValue()
      Returns the signed value of the number.
      The value is prefixed with the sign.
      Returns:
      The signed value
    • toString

      @NotNull public @NotNull 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • sign

      public char sign()
      Returns the value of the sign record component.
      Returns:
      the value of the sign record component
    • value

      @NotNull public @NotNull String value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • type

      @NotNull public @NotNull NumberType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • radix

      @NotNull public @NotNull Radix radix()
      Returns the value of the radix record component.
      Returns:
      the value of the radix record component