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

com.alon.spring.crud.repository.specification.predicate.PredicateBuilderResolver Maven / Gradle / Ivy

Go to download

Projeto base para criação de serviços e recusos de CRUD com Spring Data JPA.

There is a newer version: 3.0.0
Show newest version
package com.alon.spring.crud.repository.specification.predicate;

import com.alon.querydecoder.MatchType;

public interface PredicateBuilderResolver {

    public static PredicateBuilder resolve(MatchType matchType) {
        
        switch(matchType) {
            case BT: return BetweenPredicateBuilder.getInstance();
            case CT: return ContainsPredicateBuilder.getInstance();
            case EQ: return EqualPredicateBuilder.getInstance();
            case GT: return GreaterThanPredicateBuilder.getInstance();
            case GTE: return GreaterThanOrEqualPredicateBuilder.getInstance();
            case IN: return InPredicateBuilder.getInstance();
            case LT: return LessThanPredicateBuilder.getInstance();
            case LTE: return LessThanOrEqualPredicateBuilder.getInstance();
            default: throw new IllegalArgumentException(String.format("No implementation for %s match type.", matchType.name()));
        }
        
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy