/** * Adds missing attributes to the destination map. * * @param source The source attribute map. * @param destination The destination attribute map. * @return The destination attribute map if not null, a new one otherwise. */ private Map<String, Attribute> addMissingAttributes(Map<String, Attribute> source, Map<String, Attribute> destination) { if (source != null && !source.isEmpty()) { if (destination == null) { destination = new HashMap<String, Attribute>(); } for (Map.Entry<String, Attribute> entry : source.entrySet()) { String key = entry.getKey(); Attribute destAttribute = destination.get(key); if (destAttribute == null) { destination.put(key, entry.getValue()); } else if (destAttribute instanceof ListAttribute && entry.getValue() instanceof ListAttribute && ((ListAttribute) destAttribute).isInherit()) { ((ListAttribute) destAttribute) .inherit((ListAttribute) entry.getValue()); } } } return destination; }
/** * Adds missing attributes to the destination map. * * @param source The source attribute map. * @param destination The destination attribute map. * @return The destination attribute map if not null, a new one otherwise. */ private Map<String, Attribute> addMissingAttributes(Map<String, Attribute> source, Map<String, Attribute> destination) { if (source != null && !source.isEmpty()) { if (destination == null) { destination = new HashMap<String, Attribute>(); } for (Map.Entry<String, Attribute> entry : source.entrySet()) { String key = entry.getKey(); Attribute destAttribute = destination.get(key); if (destAttribute == null) { destination.put(key, entry.getValue()); } else if (destAttribute instanceof ListAttribute && entry.getValue() instanceof ListAttribute && ((ListAttribute) destAttribute).isInherit()) { ((ListAttribute) destAttribute) .inherit((ListAttribute) entry.getValue()); } } } return destination; }
&& destAttribute instanceof ListAttribute && ((ListAttribute) destAttribute).isInherit()) { ((ListAttribute) destAttribute).inherit((ListAttribute) attribute); && destAttribute instanceof ListAttribute && ((ListAttribute) destAttribute).isInherit()) { ((ListAttribute) destAttribute).inherit((ListAttribute) attribute);
&& destAttribute instanceof ListAttribute && ((ListAttribute) destAttribute).isInherit()) { ((ListAttribute) destAttribute).inherit((ListAttribute) attribute); && destAttribute instanceof ListAttribute && ((ListAttribute) destAttribute).isInherit()) { ((ListAttribute) destAttribute).inherit((ListAttribute) attribute);