private static void populateBrooklynObjectMementoBuilder( BrooklynObject instance, AbstractMemento.Builder<?> builder) { if (Proxy.isProxyClass(instance.getClass())) { throw new IllegalStateException( "Attempt to create memento from proxy " + instance + " (would fail with wrong type)"); } builder.id = instance.getId(); builder.displayName = instance.getDisplayName(); builder.catalogItemId = instance.getCatalogItemId(); builder.type = instance.getClass().getName(); builder.typeClass = instance.getClass(); if (instance instanceof EntityAdjunct) { builder.uniqueTag = ((EntityAdjunct) instance).getUniqueTag(); } for (Object tag : instance.tags().getTags()) { builder.tags.add(tag); } }
public Builder from(FeedMemento other) { super.from(other); config.putAll(other.getConfig()); return this; }