Package ch.njol.skript.lang.function
Record Class FunctionRegistry.Retrieval<T>
java.lang.Object
java.lang.Record
ch.njol.skript.lang.function.FunctionRegistry.Retrieval<T>
- Record Components:
result- The result of the function or signature retrieval.retrieved- The function or signature that was found ifresultisEXACT.conflictingArgs- The conflicting arguments ifresultisAMBIGUOUS.
- Enclosing class:
FunctionRegistry
public static record FunctionRegistry.Retrieval<T>(@NotNull FunctionRegistry.RetrievalResult result, T retrieved, Class<?>[][] conflictingArgs)
extends Record
The result of trying to retrieve a function or signature.
When getting a function or signature, the following situations may occur.
These are specified by type.
-
NOT_REGISTERED. The specified function or signature is not registered. BothretrievedandconflictingArgswill be null. -
AMBIGUOUS. There are multiple functions or signatures that may fit the provided name and argument types.retrievedwill be null, andconflictingArgswill contain the conflicting function or signature parameters. -
EXACT. A single function or signature has been found which matches the name and argument types.retrievedwill contain the function or signature, andconflictingArgswill be null.
-
Constructor Summary
ConstructorsConstructorDescriptionRetrieval(@NotNull FunctionRegistry.RetrievalResult result, T retrieved, Class<?>[][] conflictingArgs) Creates an instance of aRetrievalrecord class. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>[][]Returns the value of theconflictingArgsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull FunctionRegistry.RetrievalResultresult()Returns the value of theresultrecord component.Returns the value of theretrievedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Retrieval
public Retrieval(@NotNull @NotNull FunctionRegistry.RetrievalResult result, T retrieved, Class<?>[][] conflictingArgs) Creates an instance of aRetrievalrecord class.- Parameters:
result- the value for theresultrecord componentretrieved- the value for theretrievedrecord componentconflictingArgs- the value for theconflictingArgsrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
retrieved
Returns the value of theretrievedrecord component.- Returns:
- the value of the
retrievedrecord component
-
conflictingArgs
Returns the value of theconflictingArgsrecord component.- Returns:
- the value of the
conflictingArgsrecord component
-