Record Class TerminalAlcohol

java.lang.Object
java.lang.Record
ke.ric.api.item.TerminalAlcohol

public record TerminalAlcohol(double abv, int quality, boolean integrated) extends Record
A finished drink's alcohol, deliberately independent of fermentation/brewing profiles.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TerminalAlcohol(double abv, int quality, boolean integrated)
    Creates an instance of a TerminalAlcohol record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    abv()
    Returns the value of the abv record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the integrated record component.
    static boolean
    isMarked(org.bukkit.inventory.ItemStack item)
    Also detects incomplete or malformed terminal metadata so callers can fail closed.
    int
    Returns the value of the quality record component.
    read(org.bukkit.inventory.ItemStack item)
     
    read(org.bukkit.persistence.PersistentDataContainer pdc)
     
    final String
    Returns a string representation of this record class.
    void
    write(org.bukkit.inventory.ItemStack item)
     

    Methods inherited from class Object

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

    • TerminalAlcohol

      public TerminalAlcohol(double abv, int quality, boolean integrated)
      Creates an instance of a TerminalAlcohol record class.
      Parameters:
      abv - the value for the abv record component
      quality - the value for the quality record component
      integrated - the value for the integrated record component
  • Method Details

    • write

      public void write(org.bukkit.inventory.ItemStack item)
    • isMarked

      public static boolean isMarked(org.bukkit.inventory.ItemStack item)
      Also detects incomplete or malformed terminal metadata so callers can fail closed.
    • read

      public static TerminalAlcohol read(org.bukkit.inventory.ItemStack item)
    • read

      public static TerminalAlcohol read(org.bukkit.persistence.PersistentDataContainer pdc)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • abv

      public double abv()
      Returns the value of the abv record component.
      Returns:
      the value of the abv record component
    • quality

      public int quality()
      Returns the value of the quality record component.
      Returns:
      the value of the quality record component
    • integrated

      public boolean integrated()
      Returns the value of the integrated record component.
      Returns:
      the value of the integrated record component