Record Class PermissionDynamicContextKey<T>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.server.permission.nodes.PermissionDynamicContextKey<T>
public record PermissionDynamicContextKey<T>(Class<T> typeToken, String name, Function<T,String> serializer)
extends Record
Represents a key that can be used to build a
PermissionDynamicContext.
Keys, along with their associated values, can be used to provide additional context for a permission handler in determining whether to grant permission for an actor and a specific node.
As an example usage, a dimension context key could be used inside a building permission check to ensure that the actor can build given those constraints.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContext(T value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theserializerrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetypeTokenrecord component.
-
Field Details
-
typeToken
-
name
The field for thenamerecord component. -
serializer
-
-
Constructor Details
-
PermissionDynamicContextKey
Creates an instance of aPermissionDynamicContextKeyrecord class.- Parameters:
typeToken- the value for thetypeTokenrecord componentname- the value for thenamerecord componentserializer- the value for theserializerrecord component
-
-
Method Details
-
createContext
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
typeToken
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
serializer
-