protected AbstractAddonActionRequest(AddonInfo addonInfo, MutableAddonRepository addonRepository, Furnace furnace) { Assert.notNull(addonInfo, "AddonInfo must not be null."); Assert.notNull(furnace, "Addon Repository must not be null."); Assert.notNull(furnace, "Furnace must not be null."); this.addonInfo = addonInfo; this.furnace = furnace; this.repository = addonRepository; }
/** * Calculate the intersection of one or more {@link VersionRange} instances, returning a single {@link VersionRange} * as the result. */ public static VersionRange intersection(VersionRange... ranges) { Assert.notNull(ranges, "Version ranges must not be null."); Assert.isTrue(ranges.length >= 1, "Version ranges must not be empty."); return intersection(Arrays.asList(ranges)); }
private MutableAddonRepository assertMutableRepository(AddonRepository repository) { Assert.isTrue(repository instanceof MutableAddonRepository, "Addon repository [" + repository.getRootDirectory().getAbsolutePath() + "] is not writable."); return (MutableAddonRepository) repository; }
public void addIrregular(String singular, String plural) { Assert.isTrue(!Strings.isNullOrEmpty(singular), "singular rule"); Assert.isTrue(!Strings.isNullOrEmpty(plural), "plural rule"); String singularRemainder = singular.length() > 1 ? singular.substring(1) : ""; String pluralRemainder = plural.length() > 1 ? plural.substring(1) : ""; addPluralize("(" + singular.charAt(0) + ")" + singularRemainder + "$", "$1" + pluralRemainder); addSingularize("(" + plural.charAt(0) + ")" + pluralRemainder + "$", "$1" + singularRemainder); }
public FileResourceModelSource(FileResource<?> fileResource) { Assert.notNull(fileResource, "POM Resource may not be null"); this.fileResource = fileResource; }
/** * @return the delegate bound to this decorator. Never a <code>null</code> reference. * @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the * same reference as this decorator class */ protected final UIInput<VALUETYPE> getDelegate() { if (delegate == null) { delegate = createDelegate(); Assert.notNull(delegate, "Delegate cannot be null"); Assert.isTrue(delegate != this, "Decorator cannot delegate to itself"); } return delegate; }
public URLArchetypeCatalogFactory(String name, URL catalogURL, String defaultRepository) { super(); Assert.notNull(name, "Name should not be null"); Assert.notNull(catalogURL, "Catalog URL must be specified"); this.name = name; this.catalogURL = catalogURL; this.defaultRepository = defaultRepository; }
/** * @return the delegate bound to this decorator. Never a <code>null</code> reference. * @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the * same reference as this decorator class */ protected final UISelectOne<VALUETYPE> getDelegate() { if (delegate == null) { delegate = createDelegate(); Assert.notNull(delegate, "Delegate cannot be null"); Assert.isTrue(delegate != this, "Decorator cannot delegate to itself"); } return delegate; }
/** * Create an instance for the provided rule. */ public RuleExecutionInformation(Rule rule) { Assert.notNull(rule, "Rule object must not be null"); this.rule = rule; }
/** * @return the delegate bound to this decorator. Never a <code>null</code> reference. * @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the * same reference as this decorator class */ protected final UIInputMany<VALUETYPE> getDelegate() { if (delegate == null) { delegate = createDelegate(); Assert.notNull(delegate, "Delegate cannot be null"); Assert.isTrue(delegate != this, "Decorator cannot delegate to itself"); } return delegate; }
/** * Construct a new {@link AbstractRulesetMetadata} instance using the given {@link String} ID. */ public AbstractRulesetMetadata(String id) { Assert.notNull(id, "Ruleset ID must not be null."); this.id = id; }
/** * @return the delegate bound to this decorator. Never a <code>null</code> reference. * @throws IllegalArgumentException if the delegate returned by {@link #createDelegate()} is <code>null</code> or the * same reference as this decorator class */ protected final UISelectMany<VALUETYPE> getDelegate() { if (delegate == null) { delegate = createDelegate(); Assert.notNull(delegate, "Delegate cannot be null"); Assert.isTrue(delegate != this, "Decorator cannot delegate to itself"); } return delegate; }
private StackBuilder(String name) { Assert.notNull(name, "Name cannot be null"); this.name = name; }
@Override public ResourceMonitor monitor(Resource<?> resource, ResourceFilter resourceFilter) { Assert.notNull(resource, "Resource cannot be null"); Assert.isTrue(resource instanceof FileResource, "Resource must be a FileResource, was " + resource.getClass().getName()); if (!resource.exists()) { throw new IllegalStateException("Resource must exist to be monitored"); } FileResource<?> fileResource = (FileResource<?>) resource; return getFileMonitor().registerMonitor(this, fileResource, resourceFilter); }
public RestWebXmlConfigurationStrategy(String path) { Assert.notNull(path, "Path cannot be null"); this.path = path; }
public RestApplicationClassConfigurationStrategy(JavaClassSource javaClass) { Assert.notNull(javaClass, "JavaClass cannot be null"); Assert.isTrue(javaClass.hasAnnotation(ApplicationPath.class), "@ApplicationPath should be present in the JavaClass"); this.applicationClass = javaClass; this.path = javaClass.getAnnotation(ApplicationPath.class).getStringValue(); }
public URLResourceImpl(ResourceFactory factory, URL resource) { super(factory, null); Assert.notNull(resource, "URL resource cannot be null"); this.resource = resource; }
@Override public boolean containsProject(Resource<?> bound, Resource<?> target, ProjectProvider buildSystem) { Assert.notNull(bound, "Boundary should not be null"); Assert.isTrue(bound.equals(target) || isParent(bound, target), "Target should be a child of bound"); boolean found = false; Resource<?> r = bound; while (r != null && !found) { found = buildSystem.containsProject(r); if (target.equals(r)) { break; } r = r.getParent(); } return found; }
protected AbstractFacetEvent(Facet<?> facet) { Assert.notNull(facet, "Facet should not be null"); this.facet = facet; }
@Override public Template create(Resource<?> template, Class<? extends Template> type) { Assert.notNull(template, "Template resource cannot be null"); Assert.isTrue(template.exists(), "Template does not exist: " + template); for (TemplateGenerator generator : getTemplateGenerators()) { if (generator.handles(type)) { return generator.create(template, type); } } return null; }