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

de.jaggl.sqlbuilder.conditions.EqualityConditions Maven / Gradle / Ivy

There is a newer version: 2.7.2
Show newest version
package de.jaggl.sqlbuilder.conditions;

import static de.jaggl.sqlbuilder.conditions.GenericCondition.GenericConditionType.IS_EQUAL_TO;
import static de.jaggl.sqlbuilder.conditions.GenericCondition.GenericConditionType.IS_NOT_EQUAL_TO;

import de.jaggl.sqlbuilder.columns.Column;
import de.jaggl.sqlbuilder.domain.Placeholder;

public interface EqualityConditions
{
    default Condition isEqualTo(Column otherColumn)
    {
        return new GenericCondition(IS_EQUAL_TO, this, otherColumn);
    }

    /**
     * Alias for {@link #isEqualTo(Column)} for shorter statements
     *
     * @param otherColumn {@link Column} to compare equality against
     * @return the {@link Condition}
     */
    default Condition eq(Column otherColumn)
    {
        return isEqualTo(otherColumn);
    }

    default Condition isEqualTo(Placeholder placeholder)
    {
        return new GenericCondition(IS_EQUAL_TO, this, placeholder);
    }

    default Condition eq(Placeholder placeholder)
    {
        return isEqualTo(placeholder);
    }

    default Condition isNotEqualTo(Column otherColumn)
    {
        return new GenericCondition(IS_NOT_EQUAL_TO, this, otherColumn);
    }

    /**
     * Alias for {@link #isNotEqualTo(Column)} for shorter statements
     *
     * @param otherColumn {@link Column} to compare equality against
     * @return the {@link Condition}
     */
    default Condition nEq(Column otherColumn)
    {
        return isNotEqualTo(otherColumn);
    }

    default Condition isNotEqualTo(Placeholder placeholder)
    {
        return new GenericCondition(IS_NOT_EQUAL_TO, this, placeholder);
    }

    default Condition nEq(Placeholder placeholder)
    {
        return isNotEqualTo(placeholder);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy