/** * Default constructor. * * @param context the context to load the directory listings. * @throws NullPointerException if {@code classLoader} is <code>null</code>. */ public ClassPathDirectoryListing(final ClassPathContext context) throws NullPointerException { Arg.checkNotNull("context", context); this.context = context; }
/** * Default constructor. * * @param rootDir the root directory within which the resources are stored. */ public DirectoryStreamHandler(final File rootDir) { Arg.checkNotNull("rootDir", rootDir); this.rootDir = rootDir; }
/** * Default constructor. * * @param element the annotated element whose Javadoc comment is to be parsed. * @throws NullPointerException if {@code element} is <code>null</code>. */ public InlineJavadocTags(final JavaAnnotatedElement element) throws NullPointerException { this.element = Arg.checkNotNull("element", element); }
/** * Default constructor. * * @param dataSource the data source proxy. * @throws NullPointerException if {@code dataSource} is <code>null</code>. */ public HSqlJndiDataSourceProxy(final JndiDataSourceProxy dataSource) throws NullPointerException { this.dataSource = Arg.checkNotNull("dataSource", dataSource); }
/** * Sets the type of the property value. Must not be <code>null</code>. * * @param type the type of the property value. * @return the builder instance. * @throws NullPointerException if {@code type} is <code>null</code>. */ public Builder with(final PropertyType type) throws NullPointerException { this.type = Arg.checkNotNull("type", type); return this; }
/** * Sets the use type of the property. * * @param useType the use type of the property. * @return the builder instance. * @throws NullPointerException if {@code useType} is <code>null</code>. */ public Builder with(final UseType useType) throws NullPointerException { this.useType = Arg.checkNotNull("useType", useType); return this; }
@Override public void addPropertyChangeListener(final String name, final PropertyChangeListener listener) throws NullPointerException { Arg.checkNotNull("name", name); Arg.checkNotNull("listener", listener); // NOPMD support.addPropertyChangeListener(name, listener); }
/** * Sets the tenant identifier to the thread-local context. * * @param tenantId the identifier of the current tenant in action. * @throws NullPointerException if {@code tenantId} is <code>null</code>. */ public static void setTenantId(final TenantId tenantId) throws NullPointerException { final ThreadLocalRuntimeAdapter adapter = LOCAL.get(); adapter.tenantId = Arg.checkNotNull("tenantId", tenantId); }
@Override public void addPropertyChangeListener(final PropertyChangeListener listener) throws NullPointerException { Arg.checkNotNull("listener", listener); support.addPropertyChangeListener(listener); }
/** * Adds the given source tree to the list of source tree. * * @param sourceTree the source tree to add. * @throws NullArgumentException if {@code sourceTree} is <code>null</code>. */ public void addSourceTree(final File sourceTree) throws NullArgumentException { Arg.checkNotNull("sourceTree", sourceTree); sourceTrees.add(sourceTree); }
/** * Adds a property provider. * * @param provider the provider to add. * @throws NullPointerException if {@code provider} is <code>null</code>. */ public void addPropertyProvider(final PropertyProvider provider) throws NullPointerException { Arg.checkNotNull("provider", provider); propertyProviders.add(provider); }
@Override public void removePropertyChangeListener(final PropertyChangeListener listener) throws NullPointerException { Arg.checkNotNull("listener", listener); support.removePropertyChangeListener(listener); }
/** * Constructor to crate a compound key. * * @param name the name of the virtual cache (e. * @param key the real key. */ public CompoundKey(final String name, final Object key) { this.name = Arg.checkNotNull("name", name); this.key = Arg.checkNotNull("key", key); this.stringRepresentation = internaltoString(name, key); }
private void addAdditionalRootUrl(final URL rootUrl) { Arg.checkNotNull("rootUrl", rootUrl); if (!additionalRootUrls.contains(rootUrl)) { additionalRootUrls.add(rootUrl); } }
/** * Constructor accepting an array of values. * * @param values the allowed values for this value range. * @throws NullArgumentException if {@code values} is <code>null</code>. */ public CollectionPropertyValueRange(final T[] values) throws NullArgumentException { Arg.checkNotNull("values", values); this.valueRange = createMap(values); }
/** * Adds the root URL of the given {@code exemplar} to the set of class path * root URLs. * * @param exemplar a sample class to derive the root URL from. * @throws NullArgumentException if {@code exemplar} is <code>null</code>. */ public void addRootUrl(final Class<?> exemplar) throws NullArgumentException { Arg.checkNotNull("exemplar", exemplar); addRootUrl(Thread.currentThread().getContextClassLoader()); }
@Override public Property getProperty(final String name) throws NullPointerException, IllegalArgumentException { Arg.checkNotNull("name", name); final Property property = ensureProperty(name, properties.get(name)); return property; }
@Override public final PropertyContext getContext(final PropertyDescriptor descriptor) throws NullPointerException { Arg.checkNotNull("descriptor", descriptor); return new MandatoryPropertyContext(registry.getContext(descriptor), descriptor); }
@Override public final Property setProperty(final PropertyKey key, final String value) throws NullPointerException, PropertyValidationException, ReadOnlyPropertyException { Arg.checkNotNull("key", key); checkWritable(key, value); final String name = key.toString(); return setPropertyAndFireEvent(name, value); }
@Override public final Property unsetProperty(final PropertyKey key) throws NullPointerException, ReadOnlyPropertyException { Arg.checkNotNull("key", key); checkWritable(key, null); final String name = key.toString(); final Property oldProperty = deletePropertyInStore(name); firePropertyChange(name, oldProperty.getValue(), null); return oldProperty; }