@Override public boolean equals(Object obj) { if (this == obj) return true; if (getClass() != obj.getClass()) return false; AdjunctType o = (AdjunctType) obj; if (!Objects.equal(name, o.getName())) return false; if (!Objects.equal(getConfigKeys(), o.getConfigKeys())) return false; return true; }
@Override protected Set<ConfigKey<?>> getKeysAtContainer(EntityAdjunct container) { return ((AbstractEntityAdjunct)container).getAdjunctType().getConfigKeys(); }
@Override Iterable<ConfigKey<?>> getBrooklynObjectTypeConfigKeys() { return ((AbstractEntityAdjunct) getBrooklynObject()).getAdjunctType().getConfigKeys(); } }
if (entry.getKey() instanceof ConfigKey) { ConfigKey key = (ConfigKey)entry.getKey(); if (adjunctType.getConfigKeys().contains(key)) { config().set(key, entry.getValue()); } else { flags = ConfigUtilsInternal.setAllConfigKeys(flags, getAdjunctType().getConfigKeys(), this);
@Override protected void addConfig(RebindContext rebindContext, PolicyMemento memento) { // TODO entity does config-lookup differently; the memento contains the config keys. // BasicEntityMemento.postDeserialize uses the injectTypeClass to call EntityTypes.getDefinedConfigKeys(clazz) Collection<ConfigKey<?>> configKeys = policy.getAdjunctType().getConfigKeys(); Map<?, ?> flags = memento.getConfig(); // First set the config keys that are known explicitly (including with deprecated names). flags = ConfigUtilsInternal.setAllConfigKeys(flags, configKeys, policy); // Note that the flags may have been set in the constructor; but non-legacy policies should have no-arg constructors if (!flags.isEmpty()) { ConfigBag configBag = ConfigBag.newInstance(flags); FlagUtils.setFieldsFromFlags(policy, configBag); FlagUtils.setAllConfigKeys(policy, configBag, false); } }