Search in sources :

Example 1 with RawAttribute

use of org.opends.server.types.RawAttribute in project OpenAM by OpenRock.

the class TokenDataEntry method getAttrList.

public List<RawAttribute> getAttrList() {
    List<RawAttribute> attrList = new ArrayList<RawAttribute>(attributeValues.size());
    Map<String, Object> map = attributeValues.asMap();
    for (String key : map.keySet()) {
        List<String> valueList = new ArrayList<String>();
        Object o = map.get(key);
        if (o instanceof Collection) {
            for (Object o2 : (Collection) o) {
                if (o2 != null) {
                    valueList.add(o2.toString());
                }
            }
        } else {
            if (o != null) {
                valueList.add(o.toString());
            }
        }
        if (!valueList.isEmpty()) {
            attrList.add(new LDAPAttribute(key, valueList));
        }
    }
    return attrList;
}
Also used : LDAPAttribute(org.opends.server.protocols.ldap.LDAPAttribute) ArrayList(java.util.ArrayList) RawAttribute(org.opends.server.types.RawAttribute) Collection(java.util.Collection)

Aggregations

ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 LDAPAttribute (org.opends.server.protocols.ldap.LDAPAttribute)1 RawAttribute (org.opends.server.types.RawAttribute)1