Record Class NegotiationResult
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.negotiation.NegotiationResult
- Record Components:
components
- The successfully negotiated components. Is empty whensuccess()
is false.success
- Whether the negotiation was successful.failureReasons
- The reasons for the failure of the negotiation. Is empty whensuccess()
is true.
@Internal
public record NegotiationResult(List<NegotiatedNetworkComponent> components, boolean success, Map<ResourceLocation,Component> failureReasons)
extends Record
Represents the result of a negotiation of network components.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<NegotiatedNetworkComponent> The field for thecomponents
record component.private final Map
<ResourceLocation, Component> The field for thefailureReasons
record component.private final boolean
The field for thesuccess
record component. -
Constructor Summary
ConstructorDescriptionNegotiationResult
(List<NegotiatedNetworkComponent> components, boolean success, Map<ResourceLocation, Component> failureReasons) Creates an instance of aNegotiationResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponents
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefailureReasons
record component.final int
hashCode()
Returns a hash code value for this object.boolean
success()
Returns the value of thesuccess
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
components
The field for thecomponents
record component. -
success
private final boolean successThe field for thesuccess
record component. -
failureReasons
The field for thefailureReasons
record component.
-
-
Constructor Details
-
NegotiationResult
public NegotiationResult(List<NegotiatedNetworkComponent> components, boolean success, Map<ResourceLocation, Component> failureReasons) Creates an instance of aNegotiationResult
record class.- Parameters:
components
- the value for thecomponents
record componentsuccess
- the value for thesuccess
record componentfailureReasons
- the value for thefailureReasons
record 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 '=='. -
components
Returns the value of thecomponents
record component.- Returns:
- the value of the
components
record component
-
success
public boolean success()Returns the value of thesuccess
record component.- Returns:
- the value of the
success
record component
-
failureReasons
Returns the value of thefailureReasons
record component.- Returns:
- the value of the
failureReasons
record component
-