Record Class FunctionReferenceParser
java.lang.Object
java.lang.Record
org.skriptlang.skript.common.function.FunctionReferenceParser
- Record Components:
context- The context of parsing.flags- The active parsing flags.
A class containing the methods to parse an expression to a
FunctionReference.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an empty value used to make DefaultFunction calling work correctly. -
Constructor Summary
ConstructorsConstructorDescriptionFunctionReferenceParser(ParseContext context, int flags) Creates an instance of aFunctionReferenceParserrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.intflags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.<T> FunctionReference<T> parseFunctionReference(String expr) Attempts to parseexpras a function reference.<T> FunctionReference<T> parseFunctionReference(String name, FunctionReference.Argument<String>[] arguments, ParseLogHandler log) Attempts to parse a function reference.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
parseFunctionReference
Attempts to parseexpras a function reference.- Type Parameters:
T- The return type of the function.- Returns:
- A
FunctionReferenceif a function is found, ornullif none is found.
-
parseFunctionReference
public <T> FunctionReference<T> parseFunctionReference(String name, FunctionReference.Argument<String>[] arguments, ParseLogHandler log) Attempts to parse a function reference.- Type Parameters:
T- The return type of the function.- Parameters:
name- The function name.arguments- The passed arguments to the function as an array ofArguments, usually parsed with aFunctionArgumentParser.log- The log handler.- Returns:
- A
FunctionReferenceif a function is found, ornullif none is found.
-
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 '=='. -
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-
flags
public int flags()Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-