[java-support] branch master updated: A generic Criterion for class-based resolvers.
Scott Cantor
cantor.2 at osu.edu
Wed Jan 9 21:36:17 EST 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=9253f0ef731dd6f806bb8d24c7fb99965144cc1d
The following commit(s) were added to refs/heads/master by this push:
new 9253f0e A generic Criterion for class-based resolvers.
9253f0e is described below
commit 9253f0ef731dd6f806bb8d24c7fb99965144cc1d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Jan 9 21:36:13 2019 -0500
A generic Criterion for class-based resolvers.
---
.../java/support/resolver/ClassCriterion.java | 55 ++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/src/main/java/net/shibboleth/utilities/java/support/resolver/ClassCriterion.java b/src/main/java/net/shibboleth/utilities/java/support/resolver/ClassCriterion.java
new file mode 100644
index 0000000..e3746c0
--- /dev/null
+++ b/src/main/java/net/shibboleth/utilities/java/support/resolver/ClassCriterion.java
@@ -0,0 +1,55 @@
+/*
+ * 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 net.shibboleth.utilities.java.support.resolver;
+
+import javax.annotation.Nonnull;
+
+import net.shibboleth.utilities.java.support.annotation.ParameterName;
+import net.shibboleth.utilities.java.support.logic.Constraint;
+
+/**
+ * A {@link Criterion} based on class type.
+ *
+ * @param <T> class type
+ *
+ * @since 8.0.0
+ */
+public class ClassCriterion<T> implements Criterion {
+
+ /** The type to search for. */
+ @Nonnull private final Class<T> classType;
+
+ /**
+ * Constructor.
+ *
+ * @param type class type of criterion
+ */
+ public ClassCriterion(@Nonnull @ParameterName(name="type") final Class<T> type) {
+ classType = Constraint.isNotNull(type, "Type cannot be null");
+ }
+
+ /**
+ * Get the class type of this criterion.
+ *
+ * @return class type
+ */
+ @Nonnull public Class<T> getType() {
+ return classType;
+ }
+
+}
\ 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