@@ -46,7 +46,9 @@ public Predicate<Object> isFalse() {
4646 public Predicate <Object > isEqualTo (Object value ) {
4747 return new DaprPredicate (part .getProperty (), value , o -> {
4848 if (!ObjectUtils .nullSafeEquals (Part .IgnoreCaseType .NEVER , part .shouldIgnoreCase ())) {
49- if (o instanceof String s1 && value instanceof String s2 ) {
49+ if ((o instanceof String ) && (value instanceof String )) {
50+ var s1 = (String )o ;
51+ var s2 = (String )value ;
5052 return s1 .equalsIgnoreCase (s2 );
5153 }
5254 }
@@ -85,7 +87,8 @@ public Predicate<Object> matches(Object value) {
8587 return ObjectUtils .nullSafeEquals (o , value );
8688 }
8789
88- if (value instanceof Pattern pattern ) {
90+ if (value instanceof Pattern ) {
91+ var pattern = (Pattern )value ;
8992 return pattern .matcher (o .toString ()).find ();
9093 }
9194
@@ -95,8 +98,10 @@ public Predicate<Object> matches(Object value) {
9598
9699 public Predicate <Object > in (Object value ) {
97100 return new DaprPredicate (part .getProperty (), value , o -> {
98- if (value instanceof Collection <?> collection ) {
99- if (o instanceof Collection <?> subSet ) {
101+ if (value instanceof Collection <?>) {
102+ var collection = (Collection <?>)value ;
103+ if (o instanceof Collection <?>) {
104+ var subSet = (Collection <?>)o ;
100105 return collection .containsAll (subSet );
101106 }
102107
@@ -117,15 +122,17 @@ public Predicate<Object> contains(Object value) {
117122 return false ;
118123 }
119124
120- if (o instanceof Collection <?> collection ) {
125+ if (o instanceof Collection <?>) {
126+ var collection = (Collection <?>)o ;
121127 return collection .contains (value );
122128 }
123129
124130 if (ObjectUtils .isArray (o )) {
125131 return ObjectUtils .containsElement (ObjectUtils .toObjectArray (o ), value );
126132 }
127133
128- if (o instanceof Map <?, ?> map ) {
134+ if (o instanceof Map <?, ?>) {
135+ var map = (Map <?, ?>)o ;
129136 return map .containsValue (value );
130137 }
131138
@@ -145,9 +152,10 @@ public Predicate<Object> contains(Object value) {
145152
146153 public Predicate <Object > startsWith (Object value ) {
147154 return new DaprPredicate (part .getProperty (), value , o -> {
148- if (!(o instanceof String s )) {
155+ if (!(o instanceof String )) {
149156 return false ;
150157 }
158+ var s = (String )o ;
151159
152160 if (ObjectUtils .nullSafeEquals (Part .IgnoreCaseType .NEVER , part .shouldIgnoreCase ())) {
153161 return s .startsWith (value .toString ());
@@ -159,10 +167,11 @@ public Predicate<Object> startsWith(Object value) {
159167
160168 public Predicate <Object > endsWith (Object value ) {
161169 return new DaprPredicate (part .getProperty (), value , o -> {
162- if (!(o instanceof String s )) {
170+ if (!(o instanceof String )) {
163171 return false ;
164172 }
165173
174+ var s = (String )o ;
166175 if (ObjectUtils .nullSafeEquals (Part .IgnoreCaseType .NEVER , part .shouldIgnoreCase ())) {
167176 return s .endsWith (value .toString ());
168177 }
0 commit comments