[java-opensaml COMMIT] in /trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic: EntityAttrib...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Sep 22 22:50:56 EDT 2014
Author: scantor
Date: Mon Sep 22 22:50:56 2014
New Revision: 4050
URL: http://svn.shibboleth.net/view/java-opensaml?rev=4050&view=rev
Log:
Add getters to facilitate Spring tests.
Modified:
trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java
trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityIdPredicate.java
Modified: trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java?rev=4050&r1=4049&r2=4050&view=diff
==============================================================================
--- trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java (original)
+++ trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java Mon Sep 22 22:50:56 2014
@@ -52,6 +52,7 @@
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -85,6 +86,24 @@
candidateSet.addAll(Collections2.filter(candidates, Predicates.notNull()));
trimTags = trim;
+ }
+
+ /**
+ * Get whether to trim tags for comparison.
+ *
+ * @return true iff tags are to be trimmed for comparison
+ */
+ public boolean getTrimTags() {
+ return trimTags;
+ }
+
+ /**
+ * Get the candidate criteria.
+ *
+ * @return the candidate criteria
+ */
+ @Nonnull @NonnullElements @Unmodifiable @NotLive public Collection<Candidate> getCandidates() {
+ return ImmutableList.copyOf(candidateSet);
}
// Checkstyle: CyclomaticComplexity OFF
@@ -198,7 +217,7 @@
* @return the exact values to match
*/
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<String> getValues() {
- return values;
+ return ImmutableList.copyOf(values);
}
/**
@@ -222,7 +241,7 @@
* @return the regular expressions to match.
*/
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<Pattern> getRegexps() {
- return regexps;
+ return ImmutableList.copyOf(regexps);
}
/**
@@ -261,8 +280,8 @@
/** {@inheritDoc} */
@Override
public boolean apply(@Nonnull final Candidate input) {
- final List<String> tagvals = input.getValues();
- final List<Pattern> tagexps = input.getRegexps();
+ final List<String> tagvals = input.values;
+ final List<Pattern> tagexps = input.regexps;
// Track whether we've found every match we need (possibly with arrays of 0 size).
final boolean[] valflags = new boolean[tagvals.size()];
Modified: trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java?rev=4050&r1=4049&r2=4050&view=diff
==============================================================================
--- trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java (original)
+++ trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java Mon Sep 22 22:50:56 2014
@@ -24,6 +24,8 @@
import javax.annotation.Nullable;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
+import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
@@ -31,6 +33,7 @@
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
@@ -59,6 +62,15 @@
}
}
+ /**
+ * Get the group name criteria.
+ *
+ * @return the group name criteria
+ */
+ @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<String> getGroupNames() {
+ return ImmutableSet.copyOf(groupNames);
+ }
+
/** {@inheritDoc} */
@Override
public boolean apply(@Nullable final EntityDescriptor input) {
Modified: trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityIdPredicate.java
[... 38 lines stripped ...]
More information about the commits
mailing list