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
-
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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
success
-
failureReason
Returns the value of thefailureReasonrecord component.- Returns:
- the value of the
failureReasonrecord component
-