io.substrait.expression.EnumArg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Create a well-defined, cross-language specification for data compute operations
package io.substrait.expression;
import io.substrait.extension.SimpleExtension;
import java.util.Optional;
import org.immutables.value.Value;
/**
* Captures the {@link SimpleExtension.EnumArgument} option value in a {@link
* SimpleExtension.Function} invocation.
*
* @see io.substrait.expression.Expression.ScalarFunctionInvocation
* @see AggregateFunctionInvocation
*/
@Value.Immutable
public interface EnumArg extends FunctionArg {
Optional value();
@Override
default R accept(
SimpleExtension.Function fnDef, int argIdx, FuncArgVisitor fnArgVisitor) throws E {
return fnArgVisitor.visitEnumArg(fnDef, argIdx, this);
}
static EnumArg of(SimpleExtension.EnumArgument enumArg, String option) {
assert (enumArg.options().contains(option));
return ImmutableEnumArg.builder().value(Optional.of(option)).build();
}
EnumArg UNSPECIFIED_ENUM_ARG = ImmutableEnumArg.builder().value(Optional.empty()).build();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy