[java-opensaml] branch main updated: Add annnotations.

Scott Cantor cantor.2 at osu.edu
Mon Nov 21 19:20:34 UTC 2022


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

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

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

The following commit(s) were added to refs/heads/main by this push:
     new 0af0afe88 Add annnotations.
0af0afe88 is described below

commit 0af0afe889a3c1841f8e534b8272fd1e55a591ad
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Nov 21 14:20:31 2022 -0500

    Add annnotations.
---
 .../org/opensaml/saml/saml2/core/Attribute.java    | 23 ++++++++++++----------
 .../java/org/opensaml/saml/saml2/core/NameID.java  | 11 +++++++----
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Attribute.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Attribute.java
index c656cad57..1546b97aa 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Attribute.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Attribute.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.saml2.core;
 
 import java.util.List;
 
+import javax.annotation.Nonnull;
 import javax.xml.namespace.QName;
 
 import org.opensaml.core.xml.AttributeExtensibleXMLObject;
@@ -26,42 +27,44 @@ import org.opensaml.core.xml.XMLObject;
 import org.opensaml.saml.common.SAMLObject;
 import org.opensaml.saml.common.xml.SAMLConstants;
 
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
 /**
  * SAML 2.0 Core Attribute.
  */
 public interface Attribute extends SAMLObject, AttributeExtensibleXMLObject {
 
     /** Local name of the Attribute element. */
-    public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Attribute";
+    @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Attribute";
 
     /** Default element name. */
-    public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+    @Nonnull public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
             SAMLConstants.SAML20_PREFIX);
 
     /** Local name of the XSI type. */
-    public static final String TYPE_LOCAL_NAME = "AttributeType";
+    @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "AttributeType";
 
     /** QName of the XSI type. */
-    public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+    @Nonnull public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
             SAMLConstants.SAML20_PREFIX);
 
     /** Name of the Name attribute. */
-    public static final String NAME_ATTTRIB_NAME = "Name";
+    @Nonnull @NotEmpty public static final String NAME_ATTTRIB_NAME = "Name";
 
     /** Name for the NameFormat attribute. */
-    public static final String NAME_FORMAT_ATTRIB_NAME = "NameFormat";
+    @Nonnull @NotEmpty public static final String NAME_FORMAT_ATTRIB_NAME = "NameFormat";
 
     /** Name of the FriendlyName attribute. */
-    public static final String FRIENDLY_NAME_ATTRIB_NAME = "FriendlyName";
+    @Nonnull @NotEmpty public static final String FRIENDLY_NAME_ATTRIB_NAME = "FriendlyName";
 
     /** Unspecified attribute format ID. */
-    public static final String UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
+    @Nonnull @NotEmpty public static final String UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
 
     /** URI reference attribute format ID. */
-    public static final String URI_REFERENCE = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
+    @Nonnull @NotEmpty public static final String URI_REFERENCE = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
 
     /** Basic attribute format ID. */
-    public static final String BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
+    @Nonnull @NotEmpty public static final String BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
 
     /**
      * Get the name of this attribute.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NameID.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NameID.java
index 6438c28ad..e784306fb 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NameID.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NameID.java
@@ -17,27 +17,30 @@
 
 package org.opensaml.saml.saml2.core;
 
+import javax.annotation.Nonnull;
 import javax.xml.namespace.QName;
 
 import org.opensaml.saml.common.SAMLObject;
 import org.opensaml.saml.common.xml.SAMLConstants;
 
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
 /**
  * SAML 2.0 Core NameID.
  */
 public interface NameID extends SAMLObject, NameIDType {
 
     /** Element local name. */
-    public static final String DEFAULT_ELEMENT_LOCAL_NAME = "NameID";
+    @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "NameID";
 
     /** Default element name. */
-    public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+    @Nonnull public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
             SAMLConstants.SAML20_PREFIX);
 
     /** Local name of the XSI type. */
-    public static final String TYPE_LOCAL_NAME = "NameIDType";
+    @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "NameIDType";
 
     /** QName of the XSI type. */
-    public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+    @Nonnull public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
             SAMLConstants.SAML20_PREFIX);
 }
\ 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