public void decorate(Map<String, ?> policyData, String policyName, Optional<String> type, Set<String> groupMembers) { List<LocationSpec<?>> locations = getLocationSpecs(policyData); for (String id : groupMembers) { EntitySpec<?> spec = specs.get(id); if (spec == null) { throw new IllegalStateException("No node " + id + " found, when setting locations"); } spec.locationSpecs(locations); } }
wrappedChild.locationSpecs(wrapperParent.getLocationSpecs()); wrappedChild.locations(wrapperParent.getLocations());
@Override protected EntitySpec<T> copyFrom(EntitySpec<T> otherSpec) { super.copyFrom(otherSpec) .additionalInterfaces(otherSpec.getAdditionalInterfaces()) .policySpecs(otherSpec.getPolicySpecs()) .policies(otherSpec.getPolicies()) .enricherSpecs(otherSpec.getEnricherSpecs()) .enrichers(otherSpec.getEnrichers()) .addInitializers(otherSpec.getInitializers()) .children(copyFromSpecs(otherSpec.getChildren())) .members(otherSpec.getMembers()) .groups(otherSpec.getGroups()) .locationSpecs(otherSpec.getLocationSpecs()) .locations(otherSpec.getLocations()); if (otherSpec.getParent() != null) parent(otherSpec.getParent()); if (otherSpec.getImplementation() != null) impl(otherSpec.getImplementation()); return this; }