All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ydb.jooq.dsl.function.builtin.RFind Maven / Gradle / Ivy

The newest version!
package tech.ydb.jooq.dsl.function.builtin;

import org.jooq.Context;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.impl.AbstractYdbFunction;
import org.jooq.types.UInteger;
import tech.ydb.jooq.YdbTypes;

import static org.jooq.impl.DSL.function;
import static org.jooq.impl.DSL.systemName;

public final class RFind extends AbstractYdbFunction {

    private static final Name RFIND = systemName("rfind");

    private final Field source;
    private final Field substring;
    private final Field startingPosition;

    public RFind(Field source, Field substring, Field startingPosition) {
        super(
                RFIND,
                YdbTypes.UINT32
        );

        this.source = source;
        this.substring = substring;
        this.startingPosition = startingPosition;
    }

    @Override
    public void accept(Context ctx) {
        if (startingPosition != null) {
            ctx.visit(function(RFIND, getDataType(), source, substring, startingPosition));
        } else {
            ctx.visit(function(RFIND, getDataType(), source, substring));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy