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

io.lhysin.mybatis.ddd.spec.Criteria Maven / Gradle / Ivy

There is a newer version: 1.1.4-REALESE
Show newest version
package io.lhysin.mybatis.ddd.spec;

import java.util.List;

import io.lhysin.mybatis.ddd.domain.Sort;
import io.lhysin.mybatis.ddd.domain.TypedCriteria;

/**
 * The interface Criteria.
 *
 * @param    the type parameter
 */
public interface Criteria {

    /**
     * Gets probe.
     *
     * @return the probe
     */
    T getProbe();

    /**
     * Gets sort.
     *
     * @return the sort
     */
    Sort getSort();

    /**
     * Create where clause list.
     *
     * @param column the column
     * @return the list
     */
    List createWhereClause(Column column);

    /**
     * Gets probe type.
     *
     * @return the probe type
     */
    default Class getProbeType() {
        return getProbe().getClass();
    }

    /**
     * Of criteria.
     *
     * @param  probe type
     * @param object probe
     * @return {@link Criteria}
     */
    static  Criteria of(T object) {
        return new TypedCriteria<>(object);
    }

    static  Criteria of(T object, Sort sort) {
        return new TypedCriteria<>(object, sort);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy