Record Class ColonyWork.Crafting

java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyWork.Crafting
Record Components:
recipeId - registered recipe identity
batches - outstanding direct batches
minimumStock - minimum finished output units
infinite - whether continuous production is enabled
Enclosing interface:
ColonyWork

public static record ColonyWork.Crafting(String recipeId, int batches, int minimumStock, boolean infinite) extends Record
Detached native production bill; counts represent outstanding batches and desired output units.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Crafting(String recipeId, int batches, int minimumStock, boolean infinite)
    Creates an instance of a Crafting record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the batches 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 infinite record component.
    int
    Returns the value of the minimumStock record component.
    Returns the value of the recipeId record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Crafting

      public Crafting(String recipeId, int batches, int minimumStock, boolean infinite)
      Creates an instance of a Crafting record class.
      Parameters:
      recipeId - the value for the recipeId record component
      batches - the value for the batches record component
      minimumStock - the value for the minimumStock record component
      infinite - the value for the infinite record component
  • Method Details

    • 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. 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.
    • recipeId

      public String recipeId()
      Returns the value of the recipeId record component.
      Returns:
      the value of the recipeId record component
    • batches

      public int batches()
      Returns the value of the batches record component.
      Returns:
      the value of the batches record component
    • minimumStock

      public int minimumStock()
      Returns the value of the minimumStock record component.
      Returns:
      the value of the minimumStock record component
    • infinite

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