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

com.heliorm.impl.EnumFieldPart Maven / Gradle / Ivy

The newest version!
package com.heliorm.impl;

import com.heliorm.OrmException;
import com.heliorm.Table;
import com.heliorm.def.Continuation;
import com.heliorm.def.EnumField;

import java.util.Arrays;
import java.util.List;

/**
 * @param  Type of POJO
 * @param  Type of the enum
 * @author gideon
 */
public final class EnumFieldPart> extends FieldPart implements
        EnumField,
        WithEqualsPart,
        WithInPart, WithIsPart {

    public EnumFieldPart(Table table, Class javaType, String javaName) {
        super(table, FieldType.ENUM, javaType, javaName);
    }

    @Override
    public Continuation eq(E value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.EQ, value);
    }

    @Override
    public Continuation notEq(E value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.NOT_EQ, value);
    }

    @Override
    public Continuation isNull() throws OrmException {
        return new IsExpressionPart<>(getThis(), IsExpressionPart.Operator.IS_NULL);
    }

    @Override
    public Continuation isNotNull() throws OrmException {
        return new IsExpressionPart<>(getThis(), IsExpressionPart.Operator.IS_NOT_NULL);
    }

    @Override
    public Continuation in(List values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.IN, values);
    }

    @Override
    public Continuation notIn(List values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.NOT_IN, values);
    }

    @SafeVarargs
    @Override
    public final Continuation in(E... values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.IN, Arrays.asList(values));
    }

    @SafeVarargs
    @Override
    public final Continuation notIn(E... values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.NOT_IN, Arrays.asList(values));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy