Beispiel #1
0
 /**
  * Constructs an Rdn from the given attribute type and value. The string attribute values are not
  * interpreted as <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a> formatted RDN
  * strings. That is, the values are used literally (not parsed) and assumed to be unescaped.
  *
  * @param type The non-null and non-empty string attribute type.
  * @param value The non-null and non-empty attribute value.
  * @throws InvalidNameException If type/value cannot be used to construct a valid RDN.
  * @see #toString()
  */
 public Rdn(String type, Object value) throws InvalidNameException {
   if (value == null) {
     throw new NullPointerException("Cannot set value to null");
   }
   if (type.equals("") || isEmptyValue(value)) {
     throw new InvalidNameException(
         "type or value cannot be empty, type:" + type + " value:" + value);
   }
   entries = new ArrayList<>(DEFAULT_SIZE);
   put(type, value);
 }