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

com.speedment.runtime.join.trait.HasOnPredicates Maven / Gradle / Ivy

Go to download

A Speedment bundle that shades all dependencies into one jar. This is useful when deploying an application on a server.

The newest version!
/*
 *
 * Copyright (c) 2006-2019, Speedment, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); You may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.speedment.runtime.join.trait;

// import com.speedment.runtime.field.predicate.Inclusion;
import com.speedment.runtime.field.trait.HasComparableOperators;

/**
 *
 * @author Per Minborg
 * @param  return type
 */
public interface HasOnPredicates {

    /**
     * Adds an operation where a previous field is compared to the given
     * {@code joinedField} and whereby the operation returns true if and only
     * the previous field is equal to the given {@code joinedField}.
     *
     * @param joinedField to use by the operation
     * @return a builder with the added operation
     *
     * @throws NullPointerException if the provided {@code joinedField} is
     * {@code null}.
     */
    R equal(HasComparableOperators joinedField);

    /**
     * Adds an operation where a previous field is compared to the given
     * {@code joinedField} and whereby the operation returns true if and only
     * the previous field is not equal to the given
     * {@code joinedField}.
     *
     * @param joinedField to use by the operation
     * @return a builder with the added operation
     *
     * @throws NullPointerException if the provided {@code joinedField} is
     * {@code null}.
     */
    R notEqual(HasComparableOperators joinedField);

    /**
     * Adds an operation where a previous field is compared to the given
     * {@code joinedField} and whereby the operation returns true if and only
     * the previous field is less than the given {@code joinedField}.
     *
     * @param joinedField to use by the operation
     * @return a builder with the added operation
     *
     * @throws NullPointerException if the provided {@code joinedField} is
     * {@code null}.
     */
    R lessThan(HasComparableOperators joinedField);

    /**
     * Adds an operation where a previous field is compared to the given
     * {@code joinedField} and whereby the operation returns true if and only
     * the previous field is less or equal to the given
     * {@code joinedField}.
     *
     * @param joinedField to use by the operation
     * @return a builder with the added operation
     *
     * @throws NullPointerException if the provided {@code joinedField} is
     * {@code null}.
     */
    R lessOrEqual(HasComparableOperators joinedField);

    /**
     * Adds an operation where a previous field is compared to the given
     * {@code joinedField} and whereby the operation returns true if and only
     * the previous field is greater than the given
     * {@code joinedField}.
     *
     * @param joinedField to use by the operation
     * @return a builder with the added operation
     *
     * @throws NullPointerException if the provided {@code joinedField} is
     * {@code null}.
     */
    R greaterThan(HasComparableOperators joinedField);

    /**
     * Adds an operation where a previous field is compared to the given
     * {@code joinedField} and whereby the operation returns true if and only
     * the previous field is greater or equal to the given
     * {@code joinedField}.
     *
     * @param joinedField to use by the operation
     * @return a builder with the added operation
     *
     * @throws NullPointerException if the provided {@code joinedField} is
     * {@code null}.
     */
    R greaterOrEqual(HasComparableOperators joinedField);

//    /**
//     * Adds an operation where a previous field is compared to the given
//     * {@code joinedFieldFrom} and {@code joinedFieldTo} and whereby the
//     * operation returns true if and only the previous field is between
//     * {@code joinedFieldFrom} (inclusive>) and {@code joinedFieldTo}
//     * (exclusive).
//     *
//     * @param  entity type for both fields
//     * @param joinedFieldFrom to use by the operation
//     * @param joinedFieldTo to use by the operation
//     * @return a builder with the added operation
//     *
//     * @throws NullPointerException if either the provided
//     * {@code joinedFieldFrom} or the provided {@code joinedFieldTo } is
//     * {@code null}.
//     */
//    default  R between(
//        HasComparableOperators joinedFieldFrom,
//        HasComparableOperators joinedFieldTo
//    ) {
//        return between(joinedFieldFrom, joinedFieldTo, Inclusion.START_INCLUSIVE_END_EXCLUSIVE);
//    }
//
//    /**
//     * Adds an operation where a previous field is compared to the given
//     * {@code joinedFieldFrom} and {@code joinedFieldTo} and whereby the
//     * operation returns true if and only the previous field is between
//     * {@code joinedFieldFrom} and {@code joinedFieldTo} while considering the
//     * provided mode of {@code inclusion}.
//     * 

// * The Inclusion parameter may take the following values: // *

// * < // * pre>{@code // * START_INCLUSIVE_END_INCLUSIVE, // * START_INCLUSIVE_END_EXCLUSIVE, // * START_EXCLUSIVE_END_INCLUSIVE, // * START_EXCLUSIVE_END_EXCLUSIVE // * } // *

// * // * @param entity type for both fields // * @param joinedFieldFrom to use by the operation // * @param joinedFieldTo to use by the operation // * @param inclusion type of between (open or closed in both ends) // * @return a builder with the added operation // * // * @throws NullPointerException if either the provided // * {@code joinedFieldFrom}, the provided {@code joinedFieldTo } or the // * provided {@code inclusion} is {@code null}. // */ // R between( // HasComparableOperators joinedFieldFrom, // HasComparableOperators joinedFieldTo, // Inclusion inclusion // ); // // /** // * Adds an operation where a previous field is compared to the given // * {@code joinedFieldFrom} and {@code joinedFieldTo} and whereby the // * operation returns true if and only the previous field is not // * between {@code joinedFieldFrom} (inclusive>) and // * {@code joinedFieldTo} (exclusive). // * // * @param entity type for both fields // * @param joinedFieldFrom to use by the operation // * @param joinedFieldTo to use by the operation // * @return a builder with the added operation // * // * @throws NullPointerException if either the provided // * {@code joinedFieldFrom} or the provided {@code joinedFieldTo } is // * {@code null}. // */ // default R notBetween( // HasComparableOperators joinedFieldFrom, // HasComparableOperators joinedFieldTo // ) { // return notBetween(joinedFieldFrom, joinedFieldTo, Inclusion.START_INCLUSIVE_END_EXCLUSIVE); // } // // /** // * Adds an operation where a previous field is compared to the given // * {@code joinedFieldFrom} and {@code joinedFieldTo} and whereby the // * operation returns true if and only the previous field is not // * between {@code joinedFieldFrom} and {@code joinedFieldTo} while // * considering the provided mode of {@code inclusion}. // *

// * The Inclusion parameter may take the following values: // *

// * < // * pre>{@code // * START_INCLUSIVE_END_INCLUSIVE, // * START_INCLUSIVE_END_EXCLUSIVE, // * START_EXCLUSIVE_END_INCLUSIVE, // * START_EXCLUSIVE_END_EXCLUSIVE // * } // * // * // * @param entity type for both fields // * @param joinedFieldFrom to use by the operation // * @param joinedFieldTo to use by the operation // * @param inclusion type of between (open or closed in both ends) // * @return a builder with the added operation // * // * @throws NullPointerException if either the provided null // * {@code joinedFieldFrom}, the provided {@code joinedFieldTo } or the // * provided {@code inclusion} is {@code null}. // */ // R notBetween( // HasComparableOperators joinedFieldFrom, // HasComparableOperators joinedFieldTo, // Inclusion inclusion // ); }



© 2015 - 2024 Weber Informatics LLC | Privacy Policy