directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r606908 - in /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry: AbstractBinaryValue.java AbstractStreamedValue.java AbstractStringValue.java BinaryValue.java StreamedValue.java StringValue.java
Date Wed, 26 Dec 2007 15:27:38 GMT
Author: elecharny
Date: Wed Dec 26 07:27:37 2007
New Revision: 606908

URL: http://svn.apache.org/viewvc?rev=606908&view=rev
Log:
Reanamed the base classes to abstract classes, as they are not supposed to be intanciable.

Added:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java
      - copied, changed from r606816, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java
      - copied, changed from r606816, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StreamedValue.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java
      - copied, changed from r606816, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
Removed:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StreamedValue.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java

Copied: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java
(from r606816, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java?p2=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java&p1=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java&r1=606816&r2=606908&rev=606908&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java
Wed Dec 26 07:27:37 2007
@@ -37,10 +37,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BinaryValue implements Value<byte[]>
+public abstract class AbstractBinaryValue implements Value<byte[]>
 {
     /** logger for reporting errors that might not be handled properly upstream */
-    private static final Logger LOG = LoggerFactory.getLogger( BinaryValue.class );
+    private static final Logger LOG = LoggerFactory.getLogger( AbstractBinaryValue.class
);
 
     
     /** the wrapped binary value */
@@ -90,7 +90,7 @@
     /**
      * Creates a new instance of BinaryValue with no initial wrapped value.
      */
-    public BinaryValue()
+    public AbstractBinaryValue()
     {
     }
 
@@ -100,7 +100,7 @@
      *
      * @param wrapped the binary value to wrap
      */
-    public BinaryValue( byte[] wrapped )
+    public AbstractBinaryValue( byte[] wrapped )
     {
         set( wrapped );
     }
@@ -111,7 +111,7 @@
      *
      * @param value the binary value to copy
      */
-    public BinaryValue( BinaryValue value )
+    public AbstractBinaryValue( AbstractBinaryValue value )
     {
         if ( value != null )
         {
@@ -205,9 +205,9 @@
      *
      * @return a deep copy of the Value.
      */
-    public BinaryValue clone() throws CloneNotSupportedException
+    public AbstractBinaryValue clone() throws CloneNotSupportedException
     {
-        BinaryValue cloned = (BinaryValue)super.clone();
+        AbstractBinaryValue cloned = (AbstractBinaryValue)super.clone();
         
         cloned.wrapped = getCopy();
         
@@ -226,12 +226,12 @@
             return true;
         }
 
-        if ( ! ( obj instanceof BinaryValue ) )
+        if ( ! ( obj instanceof AbstractBinaryValue ) )
         {
             return false;
         }
 
-        BinaryValue binaryValue = ( BinaryValue ) obj;
+        AbstractBinaryValue binaryValue = ( AbstractBinaryValue ) obj;
         
         if ( isNull() ) 
         {
@@ -256,7 +256,7 @@
      *
      * @see Comparable#compareTo(Object) 
      */
-    public int compareTo( BinaryValue value )
+    public int compareTo( AbstractBinaryValue value )
     {
         if ( value == null )
         {

Copied: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java
(from r606816, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StreamedValue.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java?p2=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java&p1=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StreamedValue.java&r1=606816&r2=606908&rev=606908&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StreamedValue.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java
Wed Dec 26 07:27:37 2007
@@ -33,15 +33,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class StreamedValue implements Value<URI>
+public abstract class AbstractStreamedValue implements Value<URI>
 {
+    /** The URI pointing to the stored data */
     private URI wrapped;
 
 
     /**
      * Creates a streamed value without a wrapped URI.
      */
-    public StreamedValue()
+    public AbstractStreamedValue()
     {
     }
 
@@ -51,7 +52,7 @@
      *
      * @param wrapped the URI to wrap
      */
-    public StreamedValue( URI wrapped )
+    public AbstractStreamedValue( URI wrapped )
     {
         this.wrapped = wrapped;
     }
@@ -107,16 +108,20 @@
 
     public int compareTo( Value<URI> value )
     {
-        if ( value == null && get() == null )
+        if ( value == null )
         {
-            return 0;
+            if ( get() == null )
+            {
+                return 0;
+            }
+            else
+            {
+                return 1;
+            }
         }
-
-        if ( value == null )
+        else
         {
-            return 1;
+            throw new NotImplementedException();
         }
-
-        throw new NotImplementedException();
     }
 }

Copied: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java
(from r606816, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java?p2=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java&p1=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java&r1=606816&r2=606908&rev=606908&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java
Wed Dec 26 07:27:37 2007
@@ -32,10 +32,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class StringValue implements Value<String>
+public abstract class AbstractStringValue implements Value<String>
 {
     /** logger for reporting errors that might not be handled properly upstream */
-    private static final Logger LOG = LoggerFactory.getLogger( StringValue.class );
+    private static final Logger LOG = LoggerFactory.getLogger( AbstractStringValue.class
);
 
     /** the wrapped string value */
     private String wrapped;
@@ -84,7 +84,7 @@
     /**
      * Creates a new instance of StringValue with no value.
      */
-    public StringValue()
+    public AbstractStringValue()
     {
     }
 
@@ -94,7 +94,7 @@
      *
      * @param wrapped the actual String value to wrap
      */
-    public StringValue( String wrapped )
+    public AbstractStringValue( String wrapped )
     {
         this.wrapped = wrapped;
     }
@@ -138,12 +138,12 @@
             return false;
         }
 
-        if ( ! ( obj instanceof StringValue ) )
+        if ( ! ( obj instanceof AbstractStringValue ) )
         {
             return false;
         }
 
-        StringValue stringValue = ( StringValue ) obj;
+        AbstractStringValue stringValue = ( AbstractStringValue ) obj;
         
         if ( this.wrapped == null ) 
         {



Mime
View raw message