directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r209140 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AttributeValueAssertion.java
Date Mon, 04 Jul 2005 22:59:05 GMT
Author: elecharny
Date: Mon Jul  4 15:59:03 2005
New Revision: 209140

URL: http://svn.apache.org/viewcvs?rev=209140&view=rev
Log:
- Polished the Javadoc
- Added two toString methods

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AttributeValueAssertion.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AttributeValueAssertion.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AttributeValueAssertion.java?rev=209140&r1=209139&r2=209140&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AttributeValueAssertion.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AttributeValueAssertion.java
Mon Jul  4 15:59:03 2005
@@ -19,41 +19,99 @@
 import org.apache.asn1.ldap.codec.primitives.LdapString;
 import org.apache.asn1.primitives.OctetString;
 
+
 /**
+ * A class to store an attribute value assertion. Tha grammar is :
+ * 
+ * AttributeValueAssertion ::= SEQUENCE {
+ *           attributeDesc   AttributeDescription,
+ *           assertionValue  AssertionValue }
+ *
+ * AttributeDescription ::= LDAPString
+ * 
+ * AssertionValue ::= OCTET STRING
+ *                
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AttributeValueAssertion {
+public class AttributeValueAssertion
+{
+    //~ Instance fields ----------------------------------------------------------------------------
+
     /** The attribute description */
     private LdapString attributeDesc;
-    
+
     /** The assertion value */
     private OctetString assertionValue;
 
+    //~ Methods ------------------------------------------------------------------------------------
+
     /**
+     * Get the assertion value 
+     *
      * @return Returns the assertionValue.
      */
-    public OctetString getAssertionValue() {
+    public OctetString getAssertionValue()
+    {
         return assertionValue;
     }
-    
+
     /**
+     * Set the assertion value
+     *
      * @param assertionValue The assertionValue to set.
      */
-    public void setAssertionValue(OctetString assertionValue) {
+    public void setAssertionValue( OctetString assertionValue )
+    {
         this.assertionValue = assertionValue;
     }
-    
+
     /**
+     * Get the attribute description
+     *
      * @return Returns the attributeDesc.
      */
-    public String getAttributeDesc() {
-        return (attributeDesc == null ? null : attributeDesc.toString());
+    public String getAttributeDesc()
+    {
+        return ( ( attributeDesc == null ) ? null : attributeDesc.toString() );
     }
-    
+
     /**
+     * Set the attribute description
+     *
      * @param attributeDesc The attributeDesc to set.
      */
-    public void setAttributeDesc(LdapString attributeDesc) {
+    public void setAttributeDesc( LdapString attributeDesc )
+    {
         this.attributeDesc = attributeDesc;
+    }
+
+    /**
+     * Get a String representation of an AttributeValueAssertion
+     *
+     * @param tabs The spacing to be put before the string 
+     * @return An AttributeValueAssertion String 
+     */
+    public String toString( String tabs )
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( tabs ).append( "AttributeValueAssertion\n" );
+        sb.append( tabs ).append( "    Assertion description : '" )
+          .append( attributeDesc.toString() ).append( "'\n" );
+        sb.append( tabs ).append( "    Assertion value : '" ).append( assertionValue.toString()
)
+          .append( "'\n" );
+
+        return sb.toString();
+    }
+
+    /**
+     * Get a String representation of an AttributeValueAssertion
+     * 
+     * @return An AttributeValueAssertion String
+     */
+    public String toString()
+    {
+        return toString( "" );
     }
 }



Mime
View raw message