/** * Create new parameter. * * @param name the parameter name * @param value the parameter value * @return the new parameter * @throws NullPointerException if the name of the value is null * @throws IllegalArgumentException if the value is empty or contains a null component */ public static RequestParameter create(String name, String[] value) throws NullPointerException, IllegalArgumentException { return new RequestParameter(name, null, value); }
/** * Create new parameter. * * @param name the parameter name * @param value the parameter value * @return the new parameter * @throws NullPointerException if the name of the value is null * @throws IllegalArgumentException if the value is empty or contains a null component */ public static RequestParameter create(String name, String[] value) throws NullPointerException, IllegalArgumentException { return new RequestParameter(name, null, value); }
/** * Create new parameter. * * @param name the parameter name * @param value the parameter value * @return the new parameter * @throws NullPointerException if the name of the value is null */ public static RequestParameter create(String name, String raw, String value) throws NullPointerException { if (value == null) { throw new NullPointerException("No null value accepted"); } return new RequestParameter(name, new String[]{raw}, new String[]{value}); }
/** * Create new parameter. * * @param name the parameter name * @param value the parameter value * @return the new parameter * @throws NullPointerException if the name of the value is null */ public static RequestParameter create(String name, String value) throws NullPointerException { if (value == null) { throw new NullPointerException("No null value accepted"); } return new RequestParameter(name, null, new String[]{value}); }
/** * Create new parameter. * * @param name the parameter name * @param value the parameter value * @return the new parameter * @throws NullPointerException if the name of the value is null */ public static RequestParameter create(String name, String raw, String value) throws NullPointerException { if (value == null) { throw new NullPointerException("No null value accepted"); } return new RequestParameter(name, new String[]{raw}, new String[]{value}); }
/** * Create new parameter. * * @param name the parameter name * @param value the parameter value * @return the new parameter * @throws NullPointerException if the name of the value is null */ public static RequestParameter create(String name, String value) throws NullPointerException { if (value == null) { throw new NullPointerException("No null value accepted"); } return new RequestParameter(name, null, new String[]{value}); }
public RequestParameter append(String[] appended) { String[] value = new String[this.value.length + appended.length]; System.arraycopy(this.value, 0, value, 0, this.value.length); System.arraycopy(appended, 0, value, this.value.length, appended.length); return new RequestParameter(name, null, value); }
public RequestParameter append(String[] appended) { String[] value = new String[this.value.length + appended.length]; System.arraycopy(this.value, 0, value, 0, this.value.length); System.arraycopy(appended, 0, value, this.value.length, appended.length); return new RequestParameter(name, null, value); }
/** * Create new parameter. * * @param entry the parameter entry * @return the new parameter * @throws NullPointerException if the entry is null * @throws IllegalArgumentException if entry provides a null name or an illegal value */ public static RequestParameter create(Map.Entry<String, String[]> entry) throws NullPointerException, IllegalArgumentException { if (entry == null) { throw new NullPointerException("No null entry accepted"); } String name = entry.getKey(); if (name == null) { throw new IllegalArgumentException("No null name accepted"); } String[] value = entry.getValue(); if (value == null) { throw new IllegalArgumentException("No null value accepted"); } return new RequestParameter(name, null, value); }
/** * Create new parameter. * * @param entry the parameter entry * @return the new parameter * @throws NullPointerException if the entry is null * @throws IllegalArgumentException if entry provides a null name or an illegal value */ public static RequestParameter create(Map.Entry<String, String[]> entry) throws NullPointerException, IllegalArgumentException { if (entry == null) { throw new NullPointerException("No null entry accepted"); } String name = entry.getKey(); if (name == null) { throw new IllegalArgumentException("No null name accepted"); } String[] value = entry.getValue(); if (value == null) { throw new IllegalArgumentException("No null value accepted"); } return new RequestParameter(name, null, value); }
public RequestParameter append(RequestParameter appended) { return new RequestParameter(name, Tools.safeConcat(raw, appended.raw), Tools.safeConcat(value, appended.value)); }
public RequestParameter append(RequestParameter appended) { return new RequestParameter(name, Tools.safeConcat(raw, appended.raw), Tools.safeConcat(value, appended.value)); }