Search in sources :

Example 6 with RelationshipTO

use of org.apache.syncope.common.lib.to.RelationshipTO in project syncope by apache.

the class Relationships method addRelationship.

private void addRelationship(final Map<String, List<RelationshipTO>> relationships, final RelationshipTO... rels) {
    for (RelationshipTO relationship : rels) {
        final List<RelationshipTO> listrels;
        if (relationships.containsKey(relationship.getType())) {
            listrels = relationships.get(relationship.getType());
        } else {
            listrels = new ArrayList<>();
            relationships.put(relationship.getType(), listrels);
        }
        listrels.add(relationship);
    }
}
Also used : RelationshipTO(org.apache.syncope.common.lib.to.RelationshipTO)

Aggregations

RelationshipTO (org.apache.syncope.common.lib.to.RelationshipTO)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 StringUtils (org.apache.commons.lang3.StringUtils)3 AnyObjectTO (org.apache.syncope.common.lib.to.AnyObjectTO)3 AnyTO (org.apache.syncope.common.lib.to.AnyTO)3 MembershipTO (org.apache.syncope.common.lib.to.MembershipTO)3 UserTO (org.apache.syncope.common.lib.to.UserTO)3 Collection (java.util.Collection)2 Optional (java.util.Optional)2 Set (java.util.Set)2 SerializationUtils (org.apache.commons.lang3.SerializationUtils)2 Pair (org.apache.commons.lang3.tuple.Pair)2 AbstractReplacePatchItem (org.apache.syncope.common.lib.patch.AbstractReplacePatchItem)2 AnyObjectPatch (org.apache.syncope.common.lib.patch.AnyObjectPatch)2 AnyPatch (org.apache.syncope.common.lib.patch.AnyPatch)2 AttrPatch (org.apache.syncope.common.lib.patch.AttrPatch)2 BooleanReplacePatchItem (org.apache.syncope.common.lib.patch.BooleanReplacePatchItem)2 GroupPatch (org.apache.syncope.common.lib.patch.GroupPatch)2 MembershipPatch (org.apache.syncope.common.lib.patch.MembershipPatch)2