public static Map<Pair<String, String>, RelationshipTO> buildRelationshipMap( final Collection<RelationshipTO> relationships) { Map<Pair<String, String>, RelationshipTO> result = new HashMap<>(relationships.size()); relationships.forEach(rel -> result.put(Pair.of(rel.getType(), rel.getOtherEndKey()), rel)); return Collections.unmodifiableMap(result); }
@JsonIgnore @Override public Optional<RelationshipTO> getRelationship(final String type, final String otherKey) { return relationships.stream().filter( relationship -> type.equals(relationship.getType()) && otherKey.equals(relationship.getOtherEndKey())). findFirst(); }
@JsonIgnore @Override public Optional<RelationshipTO> getRelationship(final String type, final String otherKey) { return relationships.stream().filter( relationship -> type.equals(relationship.getType()) && otherKey.equals(relationship.getOtherEndKey())). findFirst(); }
@JsonIgnore @Override public Optional<RelationshipTO> getRelationship(final String type, final String otherKey) { return relationships.stream().filter( relationship -> type.equals(relationship.getType()) && otherKey.equals(relationship.getOtherEndKey())). findFirst(); }
@JsonIgnore @Override public Optional<RelationshipTO> getRelationship(final String type, final String otherKey) { return relationships.stream().filter( relationship -> type.equals(relationship.getType()) && otherKey.equals(relationship.getOtherEndKey())). findFirst(); }
@JsonIgnore @Override public Optional<RelationshipTO> getRelationship(final String type, final String otherKey) { return relationships.stream().filter( relationship -> type.equals(relationship.getType()) && otherKey.equals(relationship.getOtherEndKey())). findFirst(); }
@JsonIgnore @Override public Optional<RelationshipTO> getRelationship(final String type, final String otherKey) { return relationships.stream().filter( relationship -> type.equals(relationship.getType()) && otherKey.equals(relationship.getOtherEndKey())). findFirst(); }
public static Map<Pair<String, String>, RelationshipTO> buildRelationshipMap( final Collection<RelationshipTO> relationships) { Map<Pair<String, String>, RelationshipTO> result = new HashMap<>(relationships.size()); relationships.forEach(rel -> result.put(Pair.of(rel.getType(), rel.getOtherEndKey()), rel)); return Collections.unmodifiableMap(result); }
private void fillRelationships(final GroupableRelatableTO any, final GroupableRelatableTO template) { template.getRelationships().stream(). filter(relationship -> !any.getRelationship( relationship.getOtherEndKey(), relationship.getOtherEndKey()).isPresent()). forEachOrdered(relationship -> { any.getRelationships().add(relationship); }); }
ReportXMLConst.XSD_STRING, rel.getOtherEndKey()); handler.startElement("", "", "relationship", atts); for (URelationship actualRel : user.getRelationships(rel.getOtherEndKey())) { doExtractResources( handler, anyObjectDataBinder.getAnyObjectTO(actualRel.getRightEnd(), true));
LOG.debug("Ignoring invalid relationship type {}", patch.getRelationshipTO().getType()); } else { anyObject.getRelationship(relationshipType, patch.getRelationshipTO().getOtherEndKey()). ifPresent(relationship -> { anyObject.getRelationships().remove(relationship); scce.addException(invalidAnyType); } else { AnyObject otherEnd = anyObjectDAO.find(patch.getRelationshipTO().getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid any object {}", patch.getRelationshipTO().getOtherEndKey()); } else if (anyObject.getRealm().getFullPath().startsWith(otherEnd.getRealm().getFullPath())) { ARelationship newRelationship = entityFactory.newEntity(ARelationship.class);
LOG.debug("Ignoring invalid relationship type {}", patch.getRelationshipTO().getType()); } else { user.getRelationship(relationshipType, patch.getRelationshipTO().getOtherEndKey()). ifPresent(relationship -> { user.getRelationships().remove(relationship); AnyObject otherEnd = anyObjectDAO.find(patch.getRelationshipTO().getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid any object {}", patch.getRelationshipTO().getOtherEndKey()); } else if (user.getRealm().getFullPath().startsWith(otherEnd.getRealm().getFullPath())) { URelationship newRelationship = entityFactory.newEntity(URelationship.class);
scce.addException(invalidAnyType); } else { AnyObject otherEnd = anyObjectDAO.find(relationshipTO.getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid anyObject " + relationshipTO.getOtherEndKey()); } else if (anyObject.getRealm().getFullPath().startsWith(otherEnd.getRealm().getFullPath())) { RelationshipType relationshipType = relationshipTypeDAO.find(relationshipTO.getType());
AnyObject otherEnd = anyObjectDAO.find(relationshipTO.getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid anyObject " + relationshipTO.getOtherEndKey()); } else if (user.getRealm().getFullPath().startsWith(otherEnd.getRealm().getFullPath())) { RelationshipType relationshipType = relationshipTypeDAO.find(relationshipTO.getType());