public SampleBuilderSpec<P> blanks(Collection<BlankBuilderSpec<?>> blanks) { verifyMutable(); if (this.blanks == null) { this.blanks = new ArrayList<BlankBuilderSpec<?>>(); } if (blanks != null) { for (BlankBuilderSpec<?> e : blanks) { CollectionUtils.addItem(this.blanks, e); } } return this; }
public SampleBuilderSpec<P> otherClasses(Collection<Class<?>> otherClasses) { verifyMutable(); if (this.otherClasses == null) { this.otherClasses = new TreeSet<Class<?>>(); } if (otherClasses != null) { for (Class<?> e : otherClasses) { CollectionUtils.addItem(this.otherClasses, e); } } return this; }
public SampleBuilderSpec<P> keywords(Collection<String> keywords) { verifyMutable(); if (this.keywords == null) { this.keywords = new HashSet<String>(); } if (keywords != null) { for (String e : keywords) { CollectionUtils.addItem(this.keywords, e); } } return this; }
public SampleBuilderSpec<P> names(Collection<String> names) { verifyMutable(); if (this.names == null) { this.names = new ArrayList<String>(); } if (names != null) { for (String e : names) { CollectionUtils.addItem(this.names, e); } } return this; }
public BlankBuilderSpec<? extends SampleBuilderSpec<P>> blanks$addBlank() { verifyMutable(); if (this.blanks == null) { this.blanks = new ArrayList<BlankBuilderSpec<?>>(); } BlankBuilderSpec<SampleBuilderSpec<P>> result = new BlankBuilderSpec<SampleBuilderSpec<P>>(this); CollectionUtils.addItem(this.blanks, result); return result; }
public SampleBuilderSpec<P> blanks$wrap(Collection<? extends Blank> blanks) { verifyMutable(); if (this.blanks == null) { this.blanks = new ArrayList<BlankBuilderSpec<?>>(); } if (blanks != null) { for (Blank e : blanks) { BlankBuilderSpec<?> wrapped = new WrapConverter(BuilderSpecs.DESTINATION_CLASS_RESOLVER, BuilderSpecs.IGNORED_TYPES) .convert(e) .to(BlankBuilderSpec.class); CollectionUtils.addItem(this.blanks, wrapped); } } return this; }
public SampleBuilderSpec<P> blanks$restoreFrom( BuilderRepository repo, Collection<Object> builderIds) { verifyMutable(); if (this.blanks == null) { this.blanks = new ArrayList<BlankBuilderSpec<?>>(); } if (builderIds != null) { for (Object builderId : builderIds) { Object restoredObject = repo.get(builderId); if (restoredObject == null) { if (repo.isSupportLazy()) { repo.addObjectStoredListener( builderId, new Procedure() { public void execute(Object... arguments) { CollectionUtils.addItem(SampleBuilderSpec.this.blanks, arguments[0]); } }); } else { throw new IllegalStateException("Object does not exist with id " + builderId); } } else if (!(restoredObject instanceof BlankBuilderSpec)) { throw new IllegalStateException( "Type mismatch for id: " + builderId + ". " + BlankBuilderSpec.class.getSimpleName() + " vs " + restoredObject.getClass().getSimpleName()); } else { CollectionUtils.addItem(this.blanks, restoredObject); } } } return this; }
public BlankBuilderSpec<Blanks$$$builder<P1>> blank$begin() { BlankBuilderSpec<Blanks$$$builder<P1>> result = new BlankBuilderSpec<Blanks$$$builder<P1>>(this); CollectionUtils.addItem(SampleBuilderSpec.this.blanks, result); return result; }