Package io.dialob.rule.parser.api
Class ImmutableVariableFinder.Function
- java.lang.Object
-
- io.dialob.rule.parser.api.ImmutableVariableFinder.Function
-
- All Implemented Interfaces:
VariableFinder.Function,VariableFinder.Var
- Enclosing class:
- ImmutableVariableFinder
@Immutable @CheckReturnValue public static final class ImmutableVariableFinder.Function extends Object implements VariableFinder.Function
Immutable implementation ofVariableFinder.Function.Use the builder to create immutable instances:
ImmutableVariableFinder.Function.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableVariableFinder.Function.BuilderBuilds instances of typeFunction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableVariableFinder.Function.Builderbuilder()Creates a builder forFunction.static ImmutableVariableFinder.FunctioncopyOf(VariableFinder.Function instance)Creates an immutable copy of aVariableFinder.Functionvalue.booleanequals(Object another)This instance is equal to all instances ofFunctionthat have equal attribute values.StringgetName()ValueTypegetValueType()inthashCode()Computes a hash code from attributes:name,valueType,isAsync.booleanisAsync()StringtoString()Prints the immutable valueFunctionwith attribute values.ImmutableVariableFinder.FunctionwithIsAsync(boolean value)Copy the current immutable object by setting a value for theisAsyncattribute.ImmutableVariableFinder.FunctionwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableVariableFinder.FunctionwithValueType(ValueType value)Copy the current immutable object by setting a value for thevalueTypeattribute.
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceVariableFinder.Var- Returns:
- The value of the
nameattribute
-
getValueType
public ValueType getValueType()
- Specified by:
getValueTypein interfaceVariableFinder.Var- Returns:
- The value of the
valueTypeattribute
-
isAsync
public boolean isAsync()
- Specified by:
isAsyncin interfaceVariableFinder.Function- Returns:
- The value of the
isAsyncattribute
-
withName
public final ImmutableVariableFinder.Function withName(String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withValueType
public final ImmutableVariableFinder.Function withValueType(ValueType value)
Copy the current immutable object by setting a value for thevalueTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for valueType- Returns:
- A modified copy of the
thisobject
-
withIsAsync
public final ImmutableVariableFinder.Function withIsAsync(boolean value)
Copy the current immutable object by setting a value for theisAsyncattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isAsync- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofFunctionthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,valueType,isAsync.
-
toString
public String toString()
Prints the immutable valueFunctionwith attribute values.
-
copyOf
public static ImmutableVariableFinder.Function copyOf(VariableFinder.Function instance)
Creates an immutable copy of aVariableFinder.Functionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Function instance
-
builder
public static ImmutableVariableFinder.Function.Builder builder()
Creates a builder forFunction.ImmutableVariableFinder.Function.builder() .name(String) // requiredname.valueType(io.dialob.rule.parser.api.ValueType) // requiredvalueType.isAsync(boolean) // requiredisAsync.build();- Returns:
- A new Function builder
-
-