class CaseFunction extends Scalar<Object, Object> {

    public static final String NAME = "case";

    public static void register(Functions.Builder module) {
        TypeSignature t = TypeSignature.parse("T");
        TypeSignature bool = TypeSignature.parse("boolean");
        module.add(
            Signature.builder()
                .name(new FunctionName(null, NAME))
                .kind(FunctionType.SCALAR)
                .typeVariableConstraints(typeVariable("T"))
                .argumentTypes(bool, t)
                .returnType(t)
                .variableArityGroup(List.of(bool, t))
                .build(),
            CaseFunction::new
        );
    }

    private CaseFunction(Signature signature, BoundSignature boundSignature) {
        super(signature, boundSignature);
    }

    @Override
    public Object evaluate(TransactionContext txnCtx, NodeContext nodeCtx, Input<Object>[] args) {<FILL_FUNCTION_BODY>}

}

        // args structure is [true, default T, condition1 Boolean, value T, condition2 Boolean, value T ...]
        // Therefore skip first pair which represents the default value
        for (int i = 2; i < args.length; i = i + 2) {
            var condition = (Boolean) args[i].value();
            if (condition != null && condition) {
                return args[i + 1].value();
            }
        }
        // Fallback to default value which is the first pair
        return args[1].value();
    
<methods>public BoundSignature boundSignature() ,public Scalar<java.lang.Object,java.lang.Object> compile(List<io.crate.expression.symbol.Symbol>, java.lang.String, io.crate.role.Roles) ,public transient abstract java.lang.Object evaluate(io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext, Input<java.lang.Object>[]) ,public io.crate.expression.symbol.Symbol normalizeSymbol(io.crate.expression.symbol.Function, io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext) ,public io.crate.metadata.functions.Signature signature() <variables>public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_AND_COMPARISON_REPLACEMENT,public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_ONLY,public static final Set<io.crate.metadata.Scalar.Feature> NO_FEATURES,protected final non-sealed BoundSignature boundSignature,protected final non-sealed io.crate.metadata.functions.Signature signature