Record Class SettlementTrading.Source

java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementTrading.Source
Record Components:
id - stable route identity
kind - packed for completed crate output; older providers may use other source kinds
capacityKey - shared production-capacity identity
cyclesPerSeason - actual completed crates in the most recent season-length day window, including today
outputs - crate identity mapped to one unit per completed packing operation
inputs - empty for completed output; ingredients have already been consumed
Enclosing interface:
SettlementTrading

public static record SettlementTrading.Source(String id, String kind, String capacityKey, double cyclesPerSeason, Map<String,Double> outputs, Map<String,Integer> inputs) extends Record
One completed packing record, retaining the original route shape for mod compatibility.
  • Constructor Details

    • Source

      public Source(String id, String kind, String capacityKey, double cyclesPerSeason, Map<String,Double> outputs, Map<String,Integer> inputs)
      Copies resource maps.
      Parameters:
      id - route identity
      kind - source category
      capacityKey - shared capacity identity
      cyclesPerSeason - available cycles
      outputs - expected per-cycle outputs
      inputs - required per-cycle inputs
      Throws:
      NullPointerException - if either map, a map key, or a 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • kind

      public String kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • capacityKey

      public String capacityKey()
      Returns the value of the capacityKey record component.
      Returns:
      the value of the capacityKey record component
    • cyclesPerSeason

      public double cyclesPerSeason()
      Returns the value of the cyclesPerSeason record component.
      Returns:
      the value of the cyclesPerSeason record component
    • outputs

      public Map<String,Double> outputs()
      Returns the value of the outputs record component.
      Returns:
      the value of the outputs record component
    • inputs

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