3737 * @author Gavin King
3838 *
3939 * @since 7.0
40- *
4140 */
4241@ Incubating
4342public interface Restriction <X > {
@@ -54,77 +53,77 @@ public interface Restriction<X> {
5453 @ Internal
5554 Predicate toPredicate (Root <? extends X > root , CriteriaBuilder builder );
5655
57- static <T ,U > Restriction <T > restrict (SingularAttribute <T ,U > attribute , Range <U > range ) {
56+ static <T , U > Restriction <T > restrict (SingularAttribute <T , U > attribute , Range <U > range ) {
5857 return new AttributeRange <>( attribute , range );
5958 }
6059
61- static <T ,U > Restriction <T > equal (SingularAttribute <T ,U > attribute , U value ) {
62- return restrict ( attribute , Range .singleValue (value ) );
60+ static <T , U > Restriction <T > equal (SingularAttribute <T , U > attribute , U value ) {
61+ return restrict ( attribute , Range .singleValue ( value ) );
6362 }
6463
65- static <T ,U > Restriction <T > unequal (SingularAttribute <T ,U > attribute , U value ) {
66- return equal (attribute , value ).negated ();
64+ static <T , U > Restriction <T > unequal (SingularAttribute <T , U > attribute , U value ) {
65+ return equal ( attribute , value ).negated ();
6766 }
6867
69- static <T > Restriction <T > equalIgnoringCase (SingularAttribute <T ,String > attribute , String value ) {
70- return restrict ( attribute , Range .singleCaseInsensitiveValue (value ) );
68+ static <T > Restriction <T > equalIgnoringCase (SingularAttribute <T , String > attribute , String value ) {
69+ return restrict ( attribute , Range .singleCaseInsensitiveValue ( value ) );
7170 }
7271
73- static <T ,U > Restriction <T > in (SingularAttribute <T ,U > attribute , java .util .List <U > values ) {
74- return restrict ( attribute , Range .valueList (values ) );
72+ static <T , U > Restriction <T > in (SingularAttribute <T , U > attribute , java .util .List <U > values ) {
73+ return restrict ( attribute , Range .valueList ( values ) );
7574 }
7675
77- static <T ,U > Restriction <T > notIn (SingularAttribute <T ,U > attribute , java .util .List <U > values ) {
78- return in (attribute , values ).negated ();
76+ static <T , U > Restriction <T > notIn (SingularAttribute <T , U > attribute , java .util .List <U > values ) {
77+ return in ( attribute , values ).negated ();
7978 }
8079
81- static <T ,U extends Comparable <U >> Restriction <T > between (SingularAttribute <T ,U > attribute , U lowerBound , U upperBound ) {
82- return restrict ( attribute , Range .closed (lowerBound , upperBound ) );
80+ static <T , U extends Comparable <U >> Restriction <T > between (SingularAttribute <T , U > attribute , U lowerBound , U upperBound ) {
81+ return restrict ( attribute , Range .closed ( lowerBound , upperBound ) );
8382 }
8483
85- static <T ,U extends Comparable <U >> Restriction <T > notBetween (SingularAttribute <T ,U > attribute , U lowerBound , U upperBound ) {
86- return between (attribute , lowerBound , upperBound ).negated ();
84+ static <T , U extends Comparable <U >> Restriction <T > notBetween (SingularAttribute <T , U > attribute , U lowerBound , U upperBound ) {
85+ return between ( attribute , lowerBound , upperBound ).negated ();
8786 }
8887
89- static <T ,U extends Comparable <U >> Restriction <T > greaterThan (SingularAttribute <T ,U > attribute , U lowerBound ) {
90- return restrict ( attribute , Range .greaterThan (lowerBound ) );
88+ static <T , U extends Comparable <U >> Restriction <T > greaterThan (SingularAttribute <T , U > attribute , U lowerBound ) {
89+ return restrict ( attribute , Range .greaterThan ( lowerBound ) );
9190 }
9291
93- static <T ,U extends Comparable <U >> Restriction <T > lessThan (SingularAttribute <T ,U > attribute , U upperBound ) {
94- return restrict ( attribute , Range .lessThan (upperBound ) );
92+ static <T , U extends Comparable <U >> Restriction <T > lessThan (SingularAttribute <T , U > attribute , U upperBound ) {
93+ return restrict ( attribute , Range .lessThan ( upperBound ) );
9594 }
9695
97- static <T ,U extends Comparable <U >> Restriction <T > greaterThanOrEqual (SingularAttribute <T ,U > attribute , U lowerBound ) {
98- return restrict ( attribute , Range .greaterThanOrEqualTo (lowerBound ) );
96+ static <T , U extends Comparable <U >> Restriction <T > greaterThanOrEqual (SingularAttribute <T , U > attribute , U lowerBound ) {
97+ return restrict ( attribute , Range .greaterThanOrEqualTo ( lowerBound ) );
9998 }
10099
101- static <T ,U extends Comparable <U >> Restriction <T > lessThanOrEqual (SingularAttribute <T ,U > attribute , U upperBound ) {
102- return restrict ( attribute , Range .lessThanOrEqualTo (upperBound ) );
100+ static <T , U extends Comparable <U >> Restriction <T > lessThanOrEqual (SingularAttribute <T , U > attribute , U upperBound ) {
101+ return restrict ( attribute , Range .lessThanOrEqualTo ( upperBound ) );
103102 }
104103
105- static <T > Restriction <T > like (SingularAttribute <T ,String > attribute , String pattern , boolean caseSensitive ) {
106- return restrict ( attribute , Range .pattern (pattern , caseSensitive ) );
104+ static <T > Restriction <T > like (SingularAttribute <T , String > attribute , String pattern , boolean caseSensitive ) {
105+ return restrict ( attribute , Range .pattern ( pattern , caseSensitive ) );
107106 }
108107
109- static <T > Restriction <T > like (SingularAttribute <T ,String > attribute , String pattern ) {
110- return like (attribute , pattern , true );
108+ static <T > Restriction <T > like (SingularAttribute <T , String > attribute , String pattern ) {
109+ return like ( attribute , pattern , true );
111110 }
112111
113- static <T > Restriction <T > notLike (SingularAttribute <T ,String > attribute , String pattern ) {
114- return like (attribute , pattern , true ).negated ();
112+ static <T > Restriction <T > notLike (SingularAttribute <T , String > attribute , String pattern ) {
113+ return like ( attribute , pattern , true ).negated ();
115114 }
116115
117- static <T > Restriction <T > notLike (SingularAttribute <T ,String > attribute , String pattern , boolean caseSensitive ) {
118- return like (attribute , pattern , caseSensitive ).negated ();
116+ static <T > Restriction <T > notLike (SingularAttribute <T , String > attribute , String pattern , boolean caseSensitive ) {
117+ return like ( attribute , pattern , caseSensitive ).negated ();
119118 }
120119
121120 @ SafeVarargs
122121 static <T > Restriction <T > and (Restriction <T >... restrictions ) {
123- return new Conjunction <>( java .util .List .of (restrictions ) );
122+ return new Conjunction <>( java .util .List .of ( restrictions ) );
124123 }
125124
126125 @ SafeVarargs
127126 static <T > Restriction <T > or (Restriction <T >... restrictions ) {
128- return new Disjunction <>( java .util .List .of (restrictions ) );
127+ return new Disjunction <>( java .util .List .of ( restrictions ) );
129128 }
130129}
0 commit comments