/** * Validates the legal characters of a percent-encoded string that * represents a URI component type. * * @param s the encoded string. * @param t the URI component type identifying the legal characters. * @throws IllegalArgumentException if the encoded string contains illegal * characters. */ public static void validate(String s, Type t) { validate(s, t, false); }
@Override public UriBuilder scheme(String scheme) { if (scheme != null) { this.scheme = scheme; UriComponent.validate(scheme, UriComponent.Type.SCHEME, true); } else { this.scheme = null; } return this; }
/** * Validates the legal characters of a percent-encoded string that * represents a URI component type. * * @param s the encoded string. * @param t the URI component type identifying the legal characters. * @throws IllegalArgumentException if the encoded string contains illegal * characters. */ public static void validate(String s, Type t) { validate(s, t, false); }
@Override public UriBuilder scheme(String scheme) { if (scheme != null) { this.scheme = scheme; UriComponent.validate(scheme, UriComponent.Type.SCHEME, true); } else { this.scheme = null; } return this; }