@Test(expected=ParsingException.class) public void splitKVPBadSpaceOnlyFlagName() throws Exception { KVP.splitKVP(" =value", KeyValuePairLoader.KVP_DELIMITER); }
public static KVP splitKVP(String arg, String delimiter) throws ParsingException { arg = TextUtil.trimToNull(arg); if (arg != null) { String[] ss = arg.split(delimiter, 2); String name = null; String value = null; if (ss.length > 0) { name = TextUtil.trimToNull(ss[0]); if (name == null) { throw new ParsingException("The key (parameter name) cannot be empty", arg); } } if (ss.length > 1) { value = ss[1]; } return new KVP(name, value); } else { return KVP.NULL_KVP; } }
KVP { public static KVP splitKVP(String arg, String delimiter) throws ParsingException { arg = TextUtil.trimToNull(arg); if (arg != null) { String[] ss = arg.split(delimiter, 2); String name = null; String value = null; if (ss.length > 0) { name = TextUtil.trimToNull(ss[0]); if (name == null) { throw new ParsingException("The key (parameter name) cannot be empty", arg); } } if (ss.length > 1) { value = ss[1]; } return new KVP(name, value); } else { return KVP.NULL_KVP; } } }
KVP { public static KVP splitKVP(String arg, String delimiter) throws ParsingException { arg = TextUtil.trimToNull(arg); if (arg != null) { String[] ss = arg.split(delimiter, 2); String name = null; String value = null; if (ss.length > 0) { name = TextUtil.trimToNull(ss[0]); if (name == null) { throw new ParsingException("The key (parameter name) cannot be empty", arg); } } if (ss.length > 1) { value = ss[1]; } return new KVP(name, value); } else { return KVP.NULL_KVP; } } private  KVP();  KVP(String name);  KVP(String name, String value); }
KVP { public static KVP splitKVP(String arg, String delimiter) throws ParsingException { arg = TextUtil.trimToNull(arg); if (arg != null) { String[] ss = arg.split(delimiter, 2); String name = null; String value = null; if (ss.length > 0) { name = TextUtil.trimToNull(ss[0]); if (name == null) { throw new ParsingException("The key (parameter name) cannot be empty", arg); } } if (ss.length > 1) { value = ss[1]; } return new KVP(name, value); } else { return KVP.NULL_KVP; } } private  KVP();  KVP(String name);  KVP(String name, String value); String getName(); String getValue(); static KVP splitKVP(String arg, String delimiter); }
KVP { public static KVP splitKVP(String arg, String delimiter) throws ParsingException { arg = TextUtil.trimToNull(arg); if (arg != null) { String[] ss = arg.split(delimiter, 2); String name = null; String value = null; if (ss.length > 0) { name = TextUtil.trimToNull(ss[0]); if (name == null) { throw new ParsingException("The key (parameter name) cannot be empty", arg); } } if (ss.length > 1) { value = ss[1]; } return new KVP(name, value); } else { return KVP.NULL_KVP; } } private  KVP();  KVP(String name);  KVP(String name, String value); String getName(); String getValue(); static KVP splitKVP(String arg, String delimiter); static final KVP NULL_KVP; }