Record Class SettlementTrading.Production

java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementTrading.Production
Record Components:
sources - completed crate production during the most recent season-length day window, including today
stock - total stored tradable resource quantities across stockpiles; reservations are not subtracted
selectedExports - resources explicitly selected for recurring export
minimumStocks - legacy field, empty for recorded production
freeInputs - legacy field, empty for recorded production
workers - legacy field, zero for recorded production
daysPerSeason - native season length
Enclosing interface:
SettlementTrading

public static record SettlementTrading.Production(List<SettlementTrading.Source> sources, Map<String,Integer> stock, Set<String> selectedExports, Map<String,Integer> minimumStocks, Set<String> freeInputs, int workers, int daysPerSeason) extends Record
Detached completed-production query used by trade policies and colony extensions.
  • Constructor Details

    • Production

      public Production(List<SettlementTrading.Source> sources, Map<String,Integer> stock, Set<String> selectedExports, Map<String,Integer> minimumStocks, Set<String> freeInputs, int workers, int daysPerSeason)
      Detaches all collection values.
      Parameters:
      sources - production routes
      stock - stored tradable inventory totals, without reservation subtraction
      selectedExports - chosen resource identifiers
      minimumStocks - configured minimum-stock output targets
      freeInputs - naturally available basic inputs
      workers - eligible workforce
      daysPerSeason - season length
      Throws:
      NullPointerException - if a collection, collection entry, map key, or map value is null
  • 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.
    • sources

      public List<SettlementTrading.Source> sources()
      Returns the value of the sources record component.
      Returns:
      the value of the sources record component
    • stock

      public Map<String,Integer> stock()
      Returns the value of the stock record component.
      Returns:
      the value of the stock record component
    • selectedExports

      public Set<String> selectedExports()
      Returns the value of the selectedExports record component.
      Returns:
      the value of the selectedExports record component
    • minimumStocks

      public Map<String,Integer> minimumStocks()
      Returns the value of the minimumStocks record component.
      Returns:
      the value of the minimumStocks record component
    • freeInputs

      public Set<String> freeInputs()
      Returns the value of the freeInputs record component.
      Returns:
      the value of the freeInputs record component
    • workers

      public int workers()
      Returns the value of the workers record component.
      Returns:
      the value of the workers record component
    • daysPerSeason

      public int daysPerSeason()
      Returns the value of the daysPerSeason record component.
      Returns:
      the value of the daysPerSeason record component