Package org.daiitech.naftah.builtin.lang
Record Class NaftahFunction
java.lang.Object
java.lang.Record
org.daiitech.naftah.builtin.lang.NaftahFunction
- Record Components:
name- the function nameuseQualifiedName- flags that the function names should be bound with the provider's nameuseQualifiedAliases- flags that the function aliases should be bound with the provider's namealiases- function aliases, list of alternative function namedescription- a brief description of the functionusage- usage information or signature of the functionreturnType- the return type class of the functionparameterTypes- a list of classes representing the parameter typesexceptionTypes- a list of classes representing the exceptions the function may throw
- All Implemented Interfaces:
Serializable
public record NaftahFunction(String name, boolean useQualifiedName, boolean useQualifiedAliases, String[] aliases, String description, String usage, Class<?> returnType, List<Class<?>> parameterTypes, List<Class<?>> exceptionTypes)
extends Record
implements Serializable
Represents a function definition in the Naftah scripting language.
This record holds metadata about a function, including its name, description, usage instructions, return type, parameter types, and declared exception types.
- Author:
- Chakib Daii
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]The field for thealiasesrecord component.private final StringThe field for thedescriptionrecord component.The field for theexceptionTypesrecord component.private final StringThe field for thenamerecord component.The field for theparameterTypesrecord component.private final Class<?>The field for thereturnTyperecord component.private static final longprivate final StringThe field for theusagerecord component.private final booleanThe field for theuseQualifiedAliasesrecord component.private final booleanThe field for theuseQualifiedNamerecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]aliases()Returns the value of thealiasesrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexceptionTypesrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.static NaftahFunctionof(String name, boolean useQualifiedName, boolean useQualifiedAliases, String[] aliases, String description, String usage, Class<?> returnType, Class<?>[] parameterTypes, Class<?>[] exceptionTypes) Factory method to create aNaftahFunctioninstance.Returns the value of theparameterTypesrecord component.Class<?>Returns the value of thereturnTyperecord component.toString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.booleanReturns the value of theuseQualifiedAliasesrecord component.booleanReturns the value of theuseQualifiedNamerecord component.
-
Field Details
-
name
The field for thenamerecord component. -
useQualifiedName
private final boolean useQualifiedNameThe field for theuseQualifiedNamerecord component. -
useQualifiedAliases
private final boolean useQualifiedAliasesThe field for theuseQualifiedAliasesrecord component. -
aliases
The field for thealiasesrecord component. -
description
The field for thedescriptionrecord component. -
usage
The field for theusagerecord component. -
returnType
The field for thereturnTyperecord component. -
parameterTypes
The field for theparameterTypesrecord component. -
exceptionTypes
The field for theexceptionTypesrecord component. -
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
NaftahFunction
public NaftahFunction(String name, boolean useQualifiedName, boolean useQualifiedAliases, String[] aliases, String description, String usage, Class<?> returnType, List<Class<?>> parameterTypes, List<Class<?>> exceptionTypes) Creates an instance of aNaftahFunctionrecord class.- Parameters:
name- the value for thenamerecord componentuseQualifiedName- the value for theuseQualifiedNamerecord componentuseQualifiedAliases- the value for theuseQualifiedAliasesrecord componentaliases- the value for thealiasesrecord componentdescription- the value for thedescriptionrecord componentusage- the value for theusagerecord componentreturnType- the value for thereturnTyperecord componentparameterTypes- the value for theparameterTypesrecord componentexceptionTypes- the value for theexceptionTypesrecord component
-
-
Method Details
-
of
public static NaftahFunction of(String name, boolean useQualifiedName, boolean useQualifiedAliases, String[] aliases, String description, String usage, Class<?> returnType, Class<?>[] parameterTypes, Class<?>[] exceptionTypes) Factory method to create aNaftahFunctioninstance.- Parameters:
name- the function nameuseQualifiedName- flags that the function names should be bound with the provider's nameuseQualifiedAliases- flags that the function aliases should be bound with the provider's namedescription- a brief description of the functionusage- usage information or signature of the functionreturnType- the return type class of the functionparameterTypes- an array of parameter type classesexceptionTypes- an array of exception type classes- Returns:
- a new
NaftahFunctioninstance
-
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
useQualifiedName
public boolean useQualifiedName()Returns the value of theuseQualifiedNamerecord component.- Returns:
- the value of the
useQualifiedNamerecord component
-
useQualifiedAliases
public boolean useQualifiedAliases()Returns the value of theuseQualifiedAliasesrecord component.- Returns:
- the value of the
useQualifiedAliasesrecord component
-
aliases
Returns the value of thealiasesrecord component.- Returns:
- the value of the
aliasesrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-
returnType
Returns the value of thereturnTyperecord component.- Returns:
- the value of the
returnTyperecord component
-
parameterTypes
Returns the value of theparameterTypesrecord component.- Returns:
- the value of the
parameterTypesrecord component
-
exceptionTypes
Returns the value of theexceptionTypesrecord component.- Returns:
- the value of the
exceptionTypesrecord component
-