/** * 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; }
/** * Sets the name of the configuration table. * * @param table the name of the configuration table. * @throws NullPointerException if {@code table} is <code>null</code>. * @throws IllegalArgumentException if {@code table} is blank. */ public final void setTable(final String table) throws NullPointerException, IllegalArgumentException { this.table = Arg.checkNotBlank("table", table); }
/** * Default constructor. * * @param propertySet the name of the set the property belongs to. * @param name the name of the property. * @throws IllegalArgumentException if {@code propertySet} is blank but not * <code>null</code> or if {@code name} is blank. */ public PropertyKey(final String propertySet, final String name) throws IllegalArgumentException { this.propertySet = Arg.checkNotBlankExceptNull("propertySet", propertySet); this.name = Arg.checkNotBlank("name", name); }
/** * Default constructor. * * @param source the optional source where the property value has been * defined. * @param name the name of the property. * @param value the value of the property. * @throws NullPointerException if {@code source} is <code>null</code>. * @throws IllegalArgumentException if {@code name} is blank. */ public Property(final PropertyLocation source, final String name, final String value) throws NullPointerException, IllegalArgumentException { this.source = Arg.checkNotNull("source", source); this.name = Arg.checkNotBlank("name", name); this.value = value; }
/** * Default constructor. * * @param name the name of the tenant. Must not be blank, but may be * <code>null</code>. * @throws IllegalArgumentException if {@code name} is blank. */ public TenantId(final String name) throws IllegalArgumentException { this.name = Arg.checkNotBlankExceptNull("name", name); }
/** * Checks if {@code value} is blank except <code>null</code> providing an * additional message. * * @param name the name of the argument of error reporting. Not used if no * exception is thrown. May be <code>null</code>, although not * recommended. * @param value the value of the argument to check to be not blank but may be * <code>null</code>. * @param message the message to pass to the exception as additional * information to the standard message being generated. * @return the passed in {@code value}. * @throws BlankExceptNullArgumentException if {@code value} is blank and not * <code>null</code>. * @param <T> a character sequence like a {@link String}. */ public static <T extends CharSequence> T checkNotBlankExceptNull( final String name, final T value, final String message) throws BlankExceptNullArgumentException { if (value != null && isBlank(value)) { throw new BlankArgumentException(name, message); } return value; }
/** * Default constructor. * * @param methodSignature the signature of the test method. * @param location the location of the test. * @throws IllegalArgumentException if {@code methodSignature} is blank. * @throws NullPointerException if {@code location} is <code>null</code>. */ public DefaultMethodInfo(final String methodSignature, final SourceCodeLocation location) throws IllegalArgumentException, NullPointerException { Arg.checkNotBlank("methodSignature", methodSignature); Arg.checkNotNull("location", location); this.methodSignature = methodSignature; this.location = location; }
/** * Default constructor. * * @param name the name of the environment. * @param node the optional identifier of the node within the given * environment. * @throws IllegalArgumentException if {@code name} or {@code node} is the * empty string or contains only white spaces. */ public EnvironmentId(final String name, final String node) throws IllegalArgumentException { this.name = Arg.checkNotBlankExceptNull("name", name); this.node = Arg.checkNotBlankExceptNull("node", node); }
/** * 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); }
/** * Sets the name of the property name column. * * @param nameColumn the name of the property name column. * @throws NullPointerException if {@code nameColumn} is <code>null</code>. * @throws IllegalArgumentException if {@code nameColumn} is blank. */ public final void setNameColumn(final String nameColumn) throws NullPointerException, IllegalArgumentException { this.nameColumn = Arg.checkNotBlank("nameColumn", nameColumn); }
/** * Default constructor. * * @param encoding the encoding used to write to the stream. * @param propertySetReportsRootDir the location for property set reports * being written to. * @param propertyReportsRootDir the location for property reports being * written to. * @throws NullPointerException if {@code encoding}, * {@code propertySetReportsRootDir} or * {@code propertyReportsRootDir} is <code>null</code>. * @throws IllegalArgumentException if {@code encoding} is blank. */ public XmlPropertyReport(final String encoding, final StreamHandler propertySetReportsRootDir, final StreamHandler propertyReportsRootDir) throws NullPointerException, IllegalArgumentException { this.encoding = Arg.checkNotBlank("encoding", encoding); this.propertySetReportsRootDir = Arg.checkNotNull("propertySetReportsRootDir", propertySetReportsRootDir); this.propertyReportsRootDir = Arg.checkNotNull("propertyReportsRootDir", propertyReportsRootDir); }
/** * Default constructor. * * @param groupId the group the application belongs to. May be * <code>null</code> * @param artifactId the name of the application. May be <code>null</code>. * @param version the version of the application. May be <code>null</code>. * @throws IllegalArgumentException if either parameter is the empty string or * contains only white spaces. */ public ApplicationId(final String groupId, final String artifactId, final String version) throws IllegalArgumentException { this.groupId = Arg.checkNotBlankExceptNull("groupId", groupId); this.artifactId = Arg.checkNotBlankExceptNull("artifactId", artifactId); this.version = Arg.checkNotBlankExceptNull("version", version); }
/** * 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 name of the property value column. * * @param valueColumn the name of the property value column. * @throws NullPointerException if {@code valueColumn} is <code>null</code>. * @throws IllegalArgumentException if {@code valueColumn} is blank. */ public final void setValueColumn(final String valueColumn) throws NullPointerException, IllegalArgumentException { this.valueColumn = Arg.checkNotBlank("valueColumn", valueColumn); }
/** * Stores the resource by the given {@code resourceId}. * * @param resourceId the identifier of the resource to store. * @param resource the resource to be stored. * @throws NullPointerException if {@code resourceId} or {@code resource} is * <code>null</code>. * @throws IllegalArgumentException if {@code resourceId} is blank. * @throws LibFaultException on any problem accessing the resource layer. */ public void storeResource(final String resourceId, final Object resource) throws NullPointerException, IllegalArgumentException, LibFaultException { Arg.checkNotBlank("resourceId", resourceId); Arg.checkNotNull("resource", resource); try { log.trace(MSG.log(STORE_RESOURCE_PREPARE, resourceId, resource)); checkAvailability(); store.put(resourceId, resource); log.debug(MSG.log(STORE_RESOURCE_SUCCESS, resourceId, resource)); } catch (final IllegalStateException e) { throw new LibFaultException(service(UNAVAILABLE, e, NAME)); } }
/** * Checks if {@code value} is blank except <code>null</code>. * * @param name the name of the argument of error reporting. Not used if no * exception is thrown. May be <code>null</code>, although not * recommended. * @param value the value of the argument to check to be not blank but may be * <code>null</code>. * @return the passed in {@code value}. * @throws BlankExceptNullArgumentException if {@code value} is blank and not * <code>null</code>. * @param <T> a character sequence like a {@link String}. */ public static <T extends CharSequence> T checkNotBlankExceptNull( final String name, final T value) throws BlankExceptNullArgumentException { checkNotBlankExceptNull(name, value, null); return value; }
/** * 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; }
/** * Sets the name of the property value column. * * @param valueColumn the name of the property value column. * @throws NullPointerException if {@code valueColumn} is <code>null</code>. * @throws IllegalArgumentException if {@code valueColumn} is blank. */ public void setValueColumn(final String valueColumn) throws NullPointerException, IllegalArgumentException { this.valueColumn = Arg.checkNotBlank("valueColumn", valueColumn); }
/** * Checks if {@code value} is blank except <code>null</code>. * * @param name the name of the argument of error reporting. Not used if no * exception is thrown. May be <code>null</code>, although not * recommended. * @param value the value of the argument to check to be not blank but may be * <code>null</code>. */ public void notBlankExceptNull(final String name, final String value) { try { Arg.checkNotBlankExceptNull(name, value); } catch (final IllegalArgumentException e) { throwables.add(e); } }
/** * 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; }