Example #1
0
 @Override
 public java.lang.String toString() {
   StringBuilder sb = new StringBuilder("{");
   for (Attribute<?> a : list) {
     if (null == a) {
       sb.append(a).append(",");
     } else {
       if (a instanceof AttributeValueAssertion) {
         Class<?> cls = AttributeFactory.valueType(a.getOid());
         if (!ByteArray.class.equals(cls)) {
           Attribute<?> _a = AttributeFactory.getAttribute(a.getOid());
           if (null != _a) {
             if (get(_a)) {
               a = _a;
             }
           }
         }
       }
       sb.append(AttributeId.valueOf(a.getOid().getType()));
       sb.append("=").append(a);
       sb.append(",");
     }
   }
   if (sb.length() > 1) {
     sb.delete(sb.length() - 1, sb.length());
   }
   sb.append("}");
   return sb.toString();
 }
Example #2
0
  private void parse(ByteBuffer bb, boolean clear) {
    Util.PrefixLengthShort.read(bb, list, clear, this);

    for (Attribute<?> a : list) {
      map.put(a.getOid(), a);
    }
  }
Example #3
0
 public boolean get(Attribute<?> p) {
   return get(p.getOid(), p);
 }
Example #4
0
 public void add(Attribute<?> attr) {
   put(attr.getOid(), attr);
 }
Example #5
0
 @SuppressWarnings("unchecked")
 public <T extends Value> Attribute<T> getAttribute(Attribute<T> attr) {
   return getAttribute(attr.getOid(), (Class<T>) attr.getValue().getClass(), attr);
 }