[java-shib-shared] branch main updated: Wrap Guava predicates for null safety.
Scott Cantor
cantor.2 at osu.edu
Thu Jan 19 19:50:22 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-shared.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=9d31c4284d552ec33c50487a3fb222f7e06f371b
The following commit(s) were added to refs/heads/main by this push:
new 9d31c428 Wrap Guava predicates for null safety.
9d31c428 is described below
commit 9d31c4284d552ec33c50487a3fb222f7e06f371b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jan 19 14:50:19 2023 -0500
Wrap Guava predicates for null safety.
---
.../shibboleth/shared/logic/PredicateSupport.java | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/shib-support/src/main/java/net/shibboleth/shared/logic/PredicateSupport.java b/shib-support/src/main/java/net/shibboleth/shared/logic/PredicateSupport.java
index 274c36c0..dd45562f 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/logic/PredicateSupport.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/logic/PredicateSupport.java
@@ -35,6 +35,34 @@ public final class PredicateSupport {
/** Constructor. */
private PredicateSupport() {
}
+
+ /**
+ * Creates a predicate that is always true.
+ *
+ * @param <T> input type
+ *
+ * @return the constructed predicate
+ *
+ * @since 9.0.0
+ */
+ @SuppressWarnings("null")
+ @Nonnull public static <T> Predicate<T> alwaysTrue() {
+ return Predicates.<T>alwaysTrue();
+ }
+
+ /**
+ * Creates a predicate that is always false.
+ *
+ * @param <T> input type
+ *
+ * @return the constructed predicate
+ *
+ * @since 9.0.0
+ */
+ @SuppressWarnings("null")
+ @Nonnull public static <T> Predicate<T> alwaysFalse() {
+ return Predicates.<T>alwaysFalse();
+ }
/**
* Creates a predicate that checks that all elements of an {@link Iterable} matches a given target predicate.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list