Record Class NegotiationConfig
java.lang.Object
java.lang.Record
com.tnsai.coordination.negotiation.NegotiationConfig
- Record Components:
type- negotiation protocol typemaxRounds- maximum negotiation roundstimeout- negotiation timeoutreservationValue- minimum acceptable value (walk-away point)initialOffer- starting offer value (-1 for auto)concessionStrategy- strategy for making concessions
public record NegotiationConfig(com.tnsai.annotations.Coordination.NegotiationType type, int maxRounds, Duration timeout, double reservationValue, double initialOffer, ConcessionStrategy concessionStrategy)
extends Record
Configuration for a negotiation session, typically extracted from
@Coordination.Negotiation.- Since:
- 0.0.2
-
Constructor Summary
ConstructorsConstructorDescriptionNegotiationConfig(com.tnsai.annotations.Coordination.NegotiationType type, int maxRounds, Duration timeout, double reservationValue, double initialOffer, ConcessionStrategy concessionStrategy) Creates an instance of aNegotiationConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconcessionStrategyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinitialOfferrecord component.intReturns the value of themaxRoundsrecord component.doubleReturns the value of thereservationValuerecord component.timeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.com.tnsai.annotations.Coordination.NegotiationTypetype()Returns the value of thetyperecord component.
-
Constructor Details
-
NegotiationConfig
public NegotiationConfig(com.tnsai.annotations.Coordination.NegotiationType type, int maxRounds, Duration timeout, double reservationValue, double initialOffer, ConcessionStrategy concessionStrategy) Creates an instance of aNegotiationConfigrecord class.- Parameters:
type- the value for thetyperecord componentmaxRounds- the value for themaxRoundsrecord componenttimeout- the value for thetimeoutrecord componentreservationValue- the value for thereservationValuerecord componentinitialOffer- the value for theinitialOfferrecord componentconcessionStrategy- the value for theconcessionStrategyrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
public com.tnsai.annotations.Coordination.NegotiationType type()Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
maxRounds
public int maxRounds()Returns the value of themaxRoundsrecord component.- Returns:
- the value of the
maxRoundsrecord component
-
timeout
Returns the value of thetimeoutrecord component.- Returns:
- the value of the
timeoutrecord component
-
reservationValue
public double reservationValue()Returns the value of thereservationValuerecord component.- Returns:
- the value of the
reservationValuerecord component
-
initialOffer
public double initialOffer()Returns the value of theinitialOfferrecord component.- Returns:
- the value of the
initialOfferrecord component
-
concessionStrategy
Returns the value of theconcessionStrategyrecord component.- Returns:
- the value of the
concessionStrategyrecord component
-