[java-opensaml] branch master updated: Criterion wrapper for a profile request context.

Scott Cantor cantor.2 at osu.edu
Tue Mar 26 22:03:00 EDT 2019


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=d8a2a1ce6a068caa8d1673623719199cf4e8ca3c

The following commit(s) were added to refs/heads/master by this push:
       new  d8a2a1c   Criterion wrapper for a profile request context.
d8a2a1c is described below

commit d8a2a1ce6a068caa8d1673623719199cf4e8ca3c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Mar 26 22:02:57 2019 -0400

    Criterion wrapper for a profile request context.
---
 .../criterion/ProfileRequestContextCriterion.java  | 89 ++++++++++++++++++++++
 .../opensaml/profile/criterion/package-info.java   | 22 ++++++
 2 files changed, 111 insertions(+)

diff --git a/opensaml-profile-api/src/main/java/org/opensaml/profile/criterion/ProfileRequestContextCriterion.java b/opensaml-profile-api/src/main/java/org/opensaml/profile/criterion/ProfileRequestContextCriterion.java
new file mode 100644
index 0000000..c6ae0b4
--- /dev/null
+++ b/opensaml-profile-api/src/main/java/org/opensaml/profile/criterion/ProfileRequestContextCriterion.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.profile.criterion;
+
+import javax.annotation.Nonnull;
+
+import org.opensaml.profile.context.ProfileRequestContext;
+
+import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.resolver.Criterion;
+
+/**
+ * {@link Criterion} representing a {@link ProfileRequestContext}.
+ *
+ * @since 4.0.0
+ */
+public final class ProfileRequestContextCriterion implements Criterion {
+
+    /** The {@link ProfileRequestContext}. */
+    @Nonnull private final ProfileRequestContext profileRequestContext;
+
+    /**
+     * Constructor.
+     * 
+     * @param prc the profile request context
+     */
+    public ProfileRequestContextCriterion(@Nonnull final ProfileRequestContext prc) {
+        profileRequestContext = Constraint.isNotNull(prc, "ProfileRequestContext cannot be null");
+    }
+
+    /**
+     * Gets the profile request context.
+     * 
+     * @return the profile request context
+     */
+    @Nonnull public ProfileRequestContext getProfileRequestContext() {
+        return profileRequestContext;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        final StringBuilder builder = new StringBuilder();
+        builder.append("ProfileRequestContextCriterion [prc=");
+        builder.append(profileRequestContext);
+        builder.append("]");
+        return builder.toString();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public int hashCode() {
+        return profileRequestContext.hashCode();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+
+        if (obj == null) {
+            return false;
+        }
+
+        if (obj instanceof ProfileRequestContextCriterion) {
+            return profileRequestContext.equals(((ProfileRequestContextCriterion) obj).profileRequestContext);
+        }
+
+        return false;
+    }
+    
+}
\ No newline at end of file
diff --git a/opensaml-profile-api/src/main/java/org/opensaml/profile/criterion/package-info.java b/opensaml-profile-api/src/main/java/org/opensaml/profile/criterion/package-info.java
new file mode 100644
index 0000000..c8b8163
--- /dev/null
+++ b/opensaml-profile-api/src/main/java/org/opensaml/profile/criterion/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Profile {@link net.shibboleth.utilities.java.support.resolver.Criterion} implementations.
+ */
+
+package org.opensaml.profile.criterion;
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list