22
33import java .util .List ;
44
5- import org .apache .commons .lang3 .tuple .ImmutableTriple ;
5+ import org .apache .commons .lang3 .tuple .Triple ;
66import org .rest .common .ClientOperation ;
77import org .rest .common .IEntity ;
88import org .rest .persistence .event .BeforeEntityCreatedEvent ;
@@ -46,7 +46,9 @@ public AbstractService( final Class< T > clazzToSet ){
4646 // search
4747
4848 @ Override
49- public List < T > search ( final ImmutableTriple < String , ClientOperation , String >... constraints ){
49+ public List < T > search ( final Triple < String , ClientOperation , String >... constraints ){
50+ Preconditions .checkState ( constraints != null );
51+ Preconditions .checkState ( constraints .length > 0 );
5052 final Specification < T > firstSpec = resolveConstraint ( constraints [0 ] );
5153 Specifications < T > specifications = Specifications .where ( firstSpec );
5254 for ( int i = 1 ; i < constraints .length ; i ++ ){
@@ -59,8 +61,9 @@ public List< T > search( final ImmutableTriple< String, ClientOperation, String
5961 return getSpecificationExecutor ().findAll ( specifications );
6062 }
6163
64+
6265 @ Override
63- public Page < T > searchPaged ( final int page , final int size , final ImmutableTriple < String , ClientOperation , String >... constraints ){
66+ public Page < T > searchPaged ( final int page , final int size , final Triple < String , ClientOperation , String >... constraints ){
6467 final Specification < T > firstSpec = resolveConstraint ( constraints [0 ] );
6568 Preconditions .checkState ( firstSpec != null );
6669 Specifications < T > specifications = Specifications .where ( firstSpec );
@@ -153,7 +156,7 @@ public long count(){
153156 protected abstract JpaSpecificationExecutor < T > getSpecificationExecutor ();
154157
155158 @ SuppressWarnings ( "static-method" )
156- public Specification < T > resolveConstraint ( final ImmutableTriple < String , ClientOperation , String > constraint ){
159+ public Specification < T > resolveConstraint ( final Triple < String , ClientOperation , String > constraint ){
157160 throw new UnsupportedOperationException ();
158161 }
159162
0 commit comments