public static <T> CompositeDomainObjectSet<T> create(Class<T> type, DomainObjectCollection<? extends T>... collections) { //noinspection unchecked DefaultDomainObjectSet<T> backingSet = new DefaultDomainObjectSet<T>(type, new CompositeCollection()); CompositeDomainObjectSet<T> out = new CompositeDomainObjectSet<T>(backingSet); for (DomainObjectCollection<? extends T> c : collections) { out.addCollection(c); } return out; }
public void addCollection(DomainObjectCollection<? extends T> collection) { if (!getStore().getCollections().contains(collection)) { getStore().addComposited(collection); collection.all(backingSet.getEventRegister().getAddAction()); collection.whenObjectRemoved(backingSet.getEventRegister().getRemoveAction()); } }
public void removeCollection(DomainObjectCollection<? extends T> collection) { getStore().removeComposited(collection); Action<? super T> action = this.backingSet.getEventRegister().getRemoveAction(); for (T item : collection) { action.execute(item); } }
@Test public void testProperties() { Project project = ProjectBuilder.builder().build(); project.getPlugins().apply(WarPlugin.class); project.getPlugins().apply(WarOverlayPlugin.class); Task warTask = project.getTasks().getByName(WarPlugin.WAR_TASK_NAME); assertThat(warTask.hasProperty("overlays")).isTrue(); assertThat(warTask.property("overlays")).isInstanceOf(DomainObjectCollection.class); }
public CompositeDomainObjectSet<T> addCollection(DomainObjectCollection<? extends T> collection) { if (!getStore().getCollections().contains(collection)) { getStore().addComposited(collection); collection.all(getEventRegister().getAddAction()); collection.whenObjectRemoved(getEventRegister().getRemoveAction()); } return this; }
public void removeCollection(DomainObjectCollection<? extends T> collection) { getStore().removeComposited(collection); Action<? super T> action = getEventRegister().getRemoveAction(); for (T item : collection) { action.execute(item); } }
public void addCollection(DomainObjectCollection<? extends T> collection) { if (!getStore().getCollections().contains(collection)) { getStore().addComposited(collection); collection.all(getEventRegister().getAddAction()); collection.whenObjectRemoved(getEventRegister().getRemoveAction()); } }
public <S extends T> DomainObjectCollection<S> withType(Class<S> type, Action<? super S> configureAction) { return backingSet.withType(type, configureAction); }
public <S extends T> DomainObjectCollection<S> withType(Class<S> type, Closure configureClosure) { return withType(type, ConfigureUtil.configureUsing(configureClosure)); }
public DomainObjectCollection<T> matching(final Spec<? super T> spec) { return filtered(createFilter(spec)); }
public DomainObjectCollection<T> matching(Closure spec) { return matching(Specs.<T>convertClosureToSpec(spec)); }
public <S extends T> DomainObjectCollection<S> withType(final Class<S> type) { return filtered(createFilter(type)); }
public <S extends T> DomainObjectCollection<S> withType(Class<S> type, Action<? super S> configureAction) { DomainObjectCollection<S> result = withType(type); result.all(configureAction); return result; }
public <S extends T> DomainObjectCollection<S> withType(Class<S> type, Closure configureClosure) { DomainObjectCollection<S> result = withType(type); result.all(configureClosure); return result; }
public <S extends U> DomainObjectCollection<S> withType(Class<S> type, Action<? super S> configureAction) { return delegate.withType(type, configureAction); }
public <S extends U> DomainObjectCollection<S> withType(Class<S> type, Closure configureClosure) { return delegate.withType(type, configureClosure); }
public <S extends T> DomainObjectCollection<S> withType(Class<S> type, Closure configureClosure) { return backingSet.withType(type, configureClosure); }
public CompositeDomainObjectSet(Class<T> type, DomainObjectCollection<? extends T>... collections) { this(type); for (DomainObjectCollection<? extends T> collection : collections) { addCollection(collection); } }
public DomainObjectCollection<LanguageSourceSet> getSource() { return source; }
DomainObjectCollection<LanguageSourceSet> getSource();