Record Class ByteSize.SimpleFormatter

java.lang.Object
java.lang.Record
org.nuxeo.common.utils.ByteSize.SimpleFormatter
All Implemented Interfaces:
ByteSize.Formatter
Enclosing class:
ByteSize

public static record ByteSize.SimpleFormatter(String byteUnit, String kibibyteUnit, String mebibyteUnit, String gibibyteUnit, String tebibyteUnit, String pebibyteUnit) extends Record implements ByteSize.Formatter
  • Constructor Details

    • SimpleFormatter

      public SimpleFormatter(String byteUnit, String kibibyteUnit, String mebibyteUnit, String gibibyteUnit, String tebibyteUnit, String pebibyteUnit)
      Creates an instance of a SimpleFormatter record class.
      Parameters:
      byteUnit - the value for the byteUnit record component
      kibibyteUnit - the value for the kibibyteUnit record component
      mebibyteUnit - the value for the mebibyteUnit record component
      gibibyteUnit - the value for the gibibyteUnit record component
      tebibyteUnit - the value for the tebibyteUnit record component
      pebibyteUnit - the value for the pebibyteUnit record component
  • Method Details

    • format

      public String format(ByteSize size)
      Specified by:
      format in interface ByteSize.Formatter
    • 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 Objects::equals(Object,Object).
      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.
    • byteUnit

      public String byteUnit()
      Returns the value of the byteUnit record component.
      Returns:
      the value of the byteUnit record component
    • kibibyteUnit

      public String kibibyteUnit()
      Returns the value of the kibibyteUnit record component.
      Returns:
      the value of the kibibyteUnit record component
    • mebibyteUnit

      public String mebibyteUnit()
      Returns the value of the mebibyteUnit record component.
      Returns:
      the value of the mebibyteUnit record component
    • gibibyteUnit

      public String gibibyteUnit()
      Returns the value of the gibibyteUnit record component.
      Returns:
      the value of the gibibyteUnit record component
    • tebibyteUnit

      public String tebibyteUnit()
      Returns the value of the tebibyteUnit record component.
      Returns:
      the value of the tebibyteUnit record component
    • pebibyteUnit

      public String pebibyteUnit()
      Returns the value of the pebibyteUnit record component.
      Returns:
      the value of the pebibyteUnit record component