Package org.springframework.ldap.support
Class LdapNameBuilder
- java.lang.Object
-
- org.springframework.ldap.support.LdapNameBuilder
-
public final class LdapNameBuilder extends java.lang.Object
Helper class for buildingLdapName
instances. Note that the first part of a Distinguished Name is the least significant, which means that when adding components, they will be added to the beginning of the resulting string, e.g.LdapNameBuilder.newInstance("dc=261consulting,dc=com").add("ou=people").build().toString();
will result inou=people,dc=261consulting,dc=com
.- Since:
- 2.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapNameBuilder
add(java.lang.String name)
Append the LdapName represented by the specified string to the currently built LdapName.LdapNameBuilder
add(java.lang.String key, java.lang.Object value)
Add a Rdn to the built LdapName.LdapNameBuilder
add(javax.naming.Name name)
Append the specified name to the currently built LdapName.javax.naming.ldap.LdapName
build()
Build the LdapName instance.static LdapNameBuilder
newInstance()
Construct a new instance, starting with a blank LdapName.static LdapNameBuilder
newInstance(java.lang.String name)
Construct a new instance, starting with an LdapName constructed from the supplied string.static LdapNameBuilder
newInstance(javax.naming.Name name)
Construct a new instance, starting with a copy of the supplied LdapName.
-
-
-
Method Detail
-
newInstance
public static LdapNameBuilder newInstance()
Construct a new instance, starting with a blank LdapName.- Returns:
- a new instance.
-
newInstance
public static LdapNameBuilder newInstance(javax.naming.Name name)
Construct a new instance, starting with a copy of the supplied LdapName.- Parameters:
name
- the starting point of the LdapName to be built.- Returns:
- a new instance.
-
newInstance
public static LdapNameBuilder newInstance(java.lang.String name)
Construct a new instance, starting with an LdapName constructed from the supplied string.- Parameters:
name
- the starting point of the LdapName to be built.- Returns:
- a new instance.
-
add
public LdapNameBuilder add(java.lang.String key, java.lang.Object value)
Add a Rdn to the built LdapName.- Parameters:
key
- the rdn attribute key.value
- the rdn value.- Returns:
- this builder.
-
add
public LdapNameBuilder add(javax.naming.Name name)
Append the specified name to the currently built LdapName.- Parameters:
name
- the name to add.- Returns:
- this builder.
-
add
public LdapNameBuilder add(java.lang.String name)
Append the LdapName represented by the specified string to the currently built LdapName.- Parameters:
name
- the name to add.- Returns:
- this builder.
-
build
public javax.naming.ldap.LdapName build()
Build the LdapName instance.- Returns:
- the LdapName instance that has been built.
-
-