You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/03/05 19:35:03 UTC
svn commit: r514790 -
/directory/shared/branches/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
Author: elecharny
Date: Mon Mar 5 10:35:03 2007
New Revision: 514790
URL: http://svn.apache.org/viewvc?view=rev&rev=514790
Log:
The getType() method has been removed and two new methods
(getUpType() and getNormType()) has been added.
Modified:
directory/shared/branches/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
Modified: directory/shared/branches/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java?view=diff&rev=514790&r1=514789&r2=514790
==============================================================================
--- directory/shared/branches/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java (original)
+++ directory/shared/branches/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java Mon Mar 5 10:35:03 2007
@@ -277,7 +277,7 @@
{
AttributeTypeAndValue currentAtav = ( AttributeTypeAndValue ) iter.next();
atavs.add( (AttributeTypeAndValue)currentAtav.clone() );
- atavTypes.put( currentAtav.getType(), currentAtav );
+ atavTypes.put( currentAtav.getUpType(), currentAtav );
}
}
}
@@ -309,7 +309,7 @@
}
else
{
- normName = atav.getType() + "=#" + StringTools.dumpHexPairs( (byte[])atav.getValue() );
+ normName = atav.getNormType() + "=#" + StringTools.dumpHexPairs( (byte[])atav.getValue() );
}
break;
@@ -366,7 +366,7 @@
{
case 0:
// This is the first AttributeTypeAndValue. Just stores it.
- atav = new AttributeTypeAndValue( normalizedType, normalizedValue );
+ atav = new AttributeTypeAndValue( type, value );
nbAtavs = 1;
atavType = normalizedType;
return;
@@ -389,7 +389,7 @@
default:
// add a new AttributeTypeAndValue
- AttributeTypeAndValue newAtav = new AttributeTypeAndValue( normalizedType, normalizedValue );
+ AttributeTypeAndValue newAtav = new AttributeTypeAndValue( type, value );
atavs.add( newAtav );
atavTypes.put( normalizedType, newAtav );
@@ -436,7 +436,7 @@
return "";
case 1:
- if ( StringTools.equals( atav.getType(), normalizedType ) )
+ if ( StringTools.equals( atav.getNormType(), normalizedType ) )
{
return atav.getValue();
}
@@ -510,7 +510,7 @@
return null;
case 1:
- if ( atav.getType().equals( normalizedType ) )
+ if ( atav.getNormType().equals( normalizedType ) )
{
return atav;
}
@@ -608,7 +608,7 @@
AttributeTypeAndValue currentAtav = (AttributeTypeAndValue)ataIter.next();
rdn.atavs.add( (AttributeTypeAndValue)currentAtav.clone() );
- rdn.atavTypes.put( currentAtav.getType(), currentAtav );
+ rdn.atavTypes.put( currentAtav.getUpType(), currentAtav );
}
break;
@@ -670,7 +670,7 @@
while( ataIter.hasNext() )
{
AttributeTypeAndValue current = (AttributeTypeAndValue)ataIter.next();
- String type = current.getType();
+ String type = current.getUpType();
if ( rdn.atavTypes.containsKey( type ) )
{
@@ -798,11 +798,11 @@
/**
- * Return the type, or the first one of we have more than one (the lowest)
+ * Return the user provided type, or the first one of we have more than one (the lowest)
*
* @return The first type of this RDN
*/
- public String getType()
+ public String getUpType()
{
switch ( nbAtavs )
{
@@ -810,10 +810,30 @@
return null;
case 1:
- return atav.getType();
+ return atav.getUpType();
default:
- return ( ( AttributeTypeAndValue )((TreeSet)atavs).first() ).getType();
+ return ( ( AttributeTypeAndValue )((TreeSet)atavs).first() ).getUpType();
+ }
+ }
+
+ /**
+ * Return the normalized type, or the first one of we have more than one (the lowest)
+ *
+ * @return The first type of this RDN
+ */
+ public String getNormType()
+ {
+ switch ( nbAtavs )
+ {
+ case 0:
+ return null;
+
+ case 1:
+ return atav.getNormType();
+
+ default:
+ return ( ( AttributeTypeAndValue )((TreeSet)atavs).first() ).getNormType();
}
}