Record Class NetworkComponentNegotiator.ComponentNegotiationResult
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.negotiation.NetworkComponentNegotiator.ComponentNegotiationResult
- Record Components:
success- If negotiation succeeded.failureReason- The reason for failure if negotiation failed.
- Enclosing class:
- NetworkComponentNegotiator
public static record NetworkComponentNegotiator.ComponentNegotiationResult(boolean success, @Nullable Component failureReason)
extends Record
The result of a negotiation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable ComponentThe field for thefailureReasonrecord component.private final booleanThe field for thesuccessrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionComponentNegotiationResult(boolean success, @Nullable Component failureReason) Creates an instance of aComponentNegotiationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable ComponentReturns the value of thefailureReasonrecord component.final inthashCode()Returns a hash code value for this object.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
success
private final boolean successThe field for thesuccessrecord component. -
failureReason
The field for thefailureReasonrecord component.
-
-
Constructor Details
-
ComponentNegotiationResult
Creates an instance of aComponentNegotiationResultrecord class.- Parameters:
success- the value for thesuccessrecord componentfailureReason- the value for thefailureReasonrecord 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 '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
failureReason
Returns the value of thefailureReasonrecord component.- Returns:
- the value of the
failureReasonrecord component
-