Record Class NegotiationData

java.lang.Object
java.lang.Record
mekhq.campaign.mission.contract.contractData.NegotiationData

public record NegotiationData(int originalPayStep, int originalSupportStep, int originalTransportStep, int originalSalvageStep, int originalCommandStep, int reputationUsed, int swapsUsed, int sacrificeBank, List<List<TermFunding>> funding) extends Record
A record of how a contract's terms were negotiated, stored on the contract so the negotiation table can be reopened and resumed rather than restarting from scratch.

The contract's live terms already hold the current (negotiated) step of each clause; this record adds what the negotiation UI cannot otherwise recover: the pre-negotiation baseline steps, the budgets already spent, and how each raised step was funded. Together they let the dialog restore the exact in-progress state and continue to enforce the per-term cap and reputation/swap limits across sessions.

The funding lists are in canonical clause order - pay, support, transport, salvage, command - matching ContractTermsData; each inner list holds one TermFunding entry per step that clause was raised.

Since:
0.51.01
  • Constructor Summary

    Constructors
    Constructor
    Description
    NegotiationData(int originalPayStep, int originalSupportStep, int originalTransportStep, int originalSalvageStep, int originalCommandStep, int reputationUsed, int swapsUsed, int sacrificeBank, List<List<TermFunding>> funding)
    Creates an instance of a NegotiationData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the funding record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the originalCommandStep record component.
    int
    Returns the value of the originalPayStep record component.
    int
    Returns the value of the originalSalvageStep record component.
    int
    Returns the value of the originalSupportStep record component.
    int
    Returns the value of the originalTransportStep record component.
    int
    Returns the value of the reputationUsed record component.
    int
    Returns the value of the sacrificeBank record component.
    int
    Returns the value of the swapsUsed 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

    • NegotiationData

      public NegotiationData(int originalPayStep, int originalSupportStep, int originalTransportStep, int originalSalvageStep, int originalCommandStep, int reputationUsed, int swapsUsed, int sacrificeBank, List<List<TermFunding>> funding)
      Creates an instance of a NegotiationData record class.
      Parameters:
      originalPayStep - the value for the originalPayStep record component
      originalSupportStep - the value for the originalSupportStep record component
      originalTransportStep - the value for the originalTransportStep record component
      originalSalvageStep - the value for the originalSalvageStep record component
      originalCommandStep - the value for the originalCommandStep record component
      reputationUsed - the value for the reputationUsed record component
      swapsUsed - the value for the swapsUsed record component
      sacrificeBank - the value for the sacrificeBank record component
      funding - the value for the funding 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.
    • originalPayStep

      public int originalPayStep()
      Returns the value of the originalPayStep record component.
      Returns:
      the value of the originalPayStep record component
    • originalSupportStep

      public int originalSupportStep()
      Returns the value of the originalSupportStep record component.
      Returns:
      the value of the originalSupportStep record component
    • originalTransportStep

      public int originalTransportStep()
      Returns the value of the originalTransportStep record component.
      Returns:
      the value of the originalTransportStep record component
    • originalSalvageStep

      public int originalSalvageStep()
      Returns the value of the originalSalvageStep record component.
      Returns:
      the value of the originalSalvageStep record component
    • originalCommandStep

      public int originalCommandStep()
      Returns the value of the originalCommandStep record component.
      Returns:
      the value of the originalCommandStep record component
    • reputationUsed

      public int reputationUsed()
      Returns the value of the reputationUsed record component.
      Returns:
      the value of the reputationUsed record component
    • swapsUsed

      public int swapsUsed()
      Returns the value of the swapsUsed record component.
      Returns:
      the value of the swapsUsed record component
    • sacrificeBank

      public int sacrificeBank()
      Returns the value of the sacrificeBank record component.
      Returns:
      the value of the sacrificeBank record component
    • funding

      public List<List<TermFunding>> funding()
      Returns the value of the funding record component.
      Returns:
      the value of the funding record component