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 if result is EXACT.
conflictingArgs - The conflicting arguments if result is AMBIGUOUS.
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. Both retrieved and conflictingArgs will be null.
  • AMBIGUOUS. There are multiple functions or signatures that may fit the provided name and argument types. retrieved will be null, and conflictingArgs will contain the conflicting function or signature parameters.
  • EXACT. A single function or signature has been found which matches the name and argument types. retrieved will contain the function or signature, and conflictingArgs will be null.

  • Constructor Details

    • Retrieval

      public Retrieval(@NotNull @NotNull FunctionRegistry.RetrievalResult result, T retrieved, Class<?>[][] conflictingArgs)
      Creates an instance of a Retrieval record class.
      Parameters:
      result - the value for the result record component
      retrieved - the value for the retrieved record component
      conflictingArgs - the value for the conflictingArgs record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • result

      @NotNull public @NotNull FunctionRegistry.RetrievalResult result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • retrieved

      public T retrieved()
      Returns the value of the retrieved record component.
      Returns:
      the value of the retrieved record component
    • conflictingArgs

      public Class<?>[][] conflictingArgs()
      Returns the value of the conflictingArgs record component.
      Returns:
      the value of the conflictingArgs record component