public SingleVersion(String version) { Assert.notNull(version, "Version must not be null."); this.version = version; }
public void setFuture(Future<Void> future) { Assert.notNull(future, "Future must not be null."); this.state.future = future; }
protected URLResourceImpl(ResourceFactory factory, Resource<?> parent, URL resource) { super(factory, parent); Assert.notNull(resource, "URL resource cannot be null"); this.resource = resource; }
public UICategoryImpl(String name, UICategory subCategory) { Assert.notNull(name, "Name must not be null."); this.name = name; this.subCategory = subCategory; }
private AddonRepositoryImpl(LockManager lock, File dir) { // TODO Assert.notNull(lock, "LockManager must not be null."); Assert.notNull(dir, "Addon directory must not be null."); this.addonDir = dir; this.lock = lock; }
public Addon setStatus(AddonStatus status) { Assert.notNull(status, "Status must not be null."); this.state.status = status; return this; }
public void setRunnable(AddonRunnable runnable) { Assert.notNull(runnable, "Runnable must not be null."); this.state.runnable = runnable; }
public URLResourceImpl(ResourceFactory factory, URL resource) { super(factory, null); Assert.notNull(resource, "URL resource cannot be null"); this.resource = resource; }
public Addon setServiceRegistry(ServiceRegistry registry) { Assert.notNull(registry, "Registry must not be null."); this.state.registry = registry; return this; }
public static boolean containsClass(ClassLoader loader, Class<?> type) { Assert.notNull(loader, "Class loader to inspect must not be null."); Assert.notNull(type, "Class to find must not be null."); try { return loader.loadClass(type.getName()).equals(type); } catch (ClassNotFoundException e) { return false; } }
public static <T> Future<T> runAsync(final Callable<T> callable) { Assert.notNull(callable, "Future task must not be null."); ExecutorService executor = Executors.newSingleThreadExecutor(); FutureTask<T> future = new FutureTask<T>(callable); executor.execute(future); executor.shutdown(); return future; }
public static AddonDependencyEntry create(AddonId id, boolean exported, boolean optional) { Assert.notNull(id, "AddonId must not be null."); AddonDependencyEntry entry = new AddonDependencyEntry(); entry.id = id; entry.exported = exported; entry.optional = optional; return entry; }
private AddonModuleLoader getAddonModuleLoader(AddonRepository repository) { Assert.notNull(repository, "Repository must not be null."); if (loader == null) { loader = new AddonModuleLoader(forge); } return loader; }
public SingleVersionRange(Version version) { Assert.notNull(version, "Version must not be null."); Assert.notNull(version.getVersionString(), "Version must not be null."); if (version.getVersionString().isEmpty()) throw new IllegalArgumentException("Version must not be empty."); this.version = version; }
public void setDependencies(Set<AddonDependency> dependencies) { Assert.notNull(dependencies, "Dependencies must not be null."); this.state.dependencies = Sets.getConcurrentSet(); this.state.dependencies.addAll(dependencies); }
public void setMissingDependencies(Set<AddonDependency> missingDependencies) { Assert.notNull(missingDependencies, "Missing dependencies must not be null."); this.state.missingDependencies = Sets.getConcurrentSet(); this.state.missingDependencies.addAll(missingDependencies); }
public static AddonId from(String name, String version, String apiVersion) { Assert.notNull(name, "Name cannot be null."); if (name.trim().isEmpty()) throw new IllegalArgumentException("Name cannot be empty."); Assert.notNull(version, "Version cannot be null."); if (version.trim().isEmpty()) throw new IllegalArgumentException("Version cannot be empty."); AddonId id = new AddonId(); id.name = name; id.version = new SingleVersion(version); if (apiVersion == null || apiVersion.trim().isEmpty()) id.apiVersion = null; else id.apiVersion = new SingleVersion(apiVersion); return id; }
public AddonRegistryImpl(Forge forge) { Assert.notNull(forge, "Forge instance must not be null."); Assert.notNull(forge.getLockManager(), "LockManager must not be null."); this.forge = forge; this.lock = forge.getLockManager(); this.tree = new AddonTree(lock); logger.log(Level.FINE, "Instantiated AddonRegistryImpl: " + this); }
public static boolean isApiCompatible(Version runtimeVersion, AddonId entry) { Assert.notNull(entry, "Addon entry must not be null."); return Versions.isApiCompatible(runtimeVersion, entry.getApiVersion()); }