@@ -429,7 +429,7 @@ public static <T> Optional<T> filter(final Optional<?> self, final Class<T> type
429
429
* @since 3.0.0
430
430
*/
431
431
public static OptionalInt filter (final OptionalInt self , final IntPredicate test ) {
432
- if (! self .isPresent () || !test .test (self .getAsInt ())) {
432
+ if (self .isEmpty () || !test .test (self .getAsInt ())) {
433
433
return OptionalInt .empty ();
434
434
}
435
435
return self ;
@@ -449,7 +449,7 @@ public static OptionalInt filter(final OptionalInt self, final IntPredicate test
449
449
* @since 3.0.0
450
450
*/
451
451
public static OptionalLong filter (final OptionalLong self , final LongPredicate test ) {
452
- if (! self .isPresent () || !test .test (self .getAsLong ())) {
452
+ if (self .isEmpty () || !test .test (self .getAsLong ())) {
453
453
return OptionalLong .empty ();
454
454
}
455
455
return self ;
@@ -469,7 +469,7 @@ public static OptionalLong filter(final OptionalLong self, final LongPredicate t
469
469
* @since 3.0.0
470
470
*/
471
471
public static OptionalDouble filter (final OptionalDouble self , final DoublePredicate test ) {
472
- if (! self .isPresent () || !test .test (self .getAsDouble ())) {
472
+ if (self .isEmpty () || !test .test (self .getAsDouble ())) {
473
473
return OptionalDouble .empty ();
474
474
}
475
475
return self ;
@@ -488,7 +488,7 @@ public static OptionalDouble filter(final OptionalDouble self, final DoublePredi
488
488
* @since 3.0.0
489
489
*/
490
490
public static <T > Optional <T > mapToObj (final OptionalInt self , final IntFunction <? extends T > mapper ) {
491
- if (! self .isPresent ()) {
491
+ if (self .isEmpty ()) {
492
492
return Optional .empty ();
493
493
}
494
494
return Optional .ofNullable (mapper .apply (self .getAsInt ()));
@@ -507,7 +507,7 @@ public static <T> Optional<T> mapToObj(final OptionalInt self, final IntFunction
507
507
* @since 3.0.0
508
508
*/
509
509
public static <T > Optional <T > mapToObj (final OptionalLong self , final LongFunction <? extends T > mapper ) {
510
- if (! self .isPresent ()) {
510
+ if (self .isEmpty ()) {
511
511
return Optional .empty ();
512
512
}
513
513
return Optional .ofNullable (mapper .apply (self .getAsLong ()));
@@ -526,7 +526,7 @@ public static <T> Optional<T> mapToObj(final OptionalLong self, final LongFuncti
526
526
* @since 3.0.0
527
527
*/
528
528
public static <T > Optional <T > mapToObj (final OptionalDouble self , final DoubleFunction <? extends T > mapper ) {
529
- if (! self .isPresent ()) {
529
+ if (self .isEmpty ()) {
530
530
return Optional .empty ();
531
531
}
532
532
return Optional .ofNullable (mapper .apply (self .getAsDouble ()));
0 commit comments