Emmanuel Lecharny schrieb: > Hi, > > as we have added a AttributeUtils.createAttributes() method which > benefits from varargs, I have also added a new LdapDN constructor doing > the same : > > LdapDN dn = new LdapDN( > "cn=varargs", > "ou=" + place, > baseDN ); > > which is creating the "cn=varargs,ou=example,dc=com" DN, if 'place' = > example and 'baseDN' = 'dc=com'. > > Do you think it's usefull ? >
Yes, very useful. Just a step further: Would it be possible to allow attribute type and value as separate arguments? The constructor could check if an argument contains an '=' in which case it would be handle the argument as the string representation of an RDN. If there is no '=' then the argument is handled as RDN attribute type and the next argument as RDN value. In the latter case the RDN value could also be provided unencoded so the user don't need to deal with RDN value encoding. For example: LdapDN dn = new LdapDN( "cn=varargs", // contains an '=' -> parse as RDN "ou", place, // no '=' -> construct RDN, unencoded value baseDN ); Kind Regards, Stefan
