[java-shib-attribute] branch main updated: IDP-2018 - Add "contains" helper method to IdPAttribute for value checks
Scott Cantor
cantor.2 at osu.edu
Mon Oct 10 17:40:54 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-attribute.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=b756ecbe125aba8222af003a65e859f5e579062e
The following commit(s) were added to refs/heads/main by this push:
new b756ecbe1 IDP-2018 - Add "contains" helper method to IdPAttribute for value checks
b756ecbe1 is described below
commit b756ecbe125aba8222af003a65e859f5e579062e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Oct 10 13:40:29 2022 -0400
IDP-2018 - Add "contains" helper method to IdPAttribute for value checks
https://shibboleth.atlassian.net/browse/IDP-2018
---
.../net/shibboleth/idp/attribute/IdPAttribute.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
index 0e78d15ad..1b2b57b25 100644
--- a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
+++ b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/IdPAttribute.java
@@ -140,6 +140,24 @@ public class IdPAttribute implements Comparable<IdPAttribute>, Cloneable {
}
}
+ /**
+ * Check for a string value amongst this object's value collection.
+ *
+ * @param value value to check for
+ *
+ * @return true iff a {@link StringAttributeValue} exists with the input value
+ *
+ * @since 4.3.0
+ */
+ public boolean contains(@Nonnull @NotEmpty final String value) {
+ for (final IdPAttributeValue v : values) {
+ if (v instanceof StringAttributeValue && ((StringAttributeValue) v).getValue().equals(value)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/** {@inheritDoc} */
@Override
public int compareTo(final IdPAttribute other) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list