/** * 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); }
/** * 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 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); }
/** * 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; }
/** * 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); } }
/** * 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); }