@Test public void testBatchRequest(){ ODataBatchUtilities util = new ODataBatchUtilities(); Map<String, Collection<String>> value = new HashMap<String, Collection<String>>(); util.addHeaderLine("header:name", value ); value.put("header:name", null); util.addHeaderLine("header:name", value ); }
public static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap) { final int sep = headerLine.indexOf(':'); if (sep > 0 && sep < headerLine.length() - 1) { final String key = headerLine.substring(0, sep).trim(); final Collection<String> value; if (targetMap.containsKey(key)) { value = targetMap.get(key); } else { value = new HashSet<>(); targetMap.put(key, value); } value.add(headerLine.substring(sep + 1, headerLine.length()).trim()); } }
ODataBatchUtilities { public static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap) { final int sep = headerLine.indexOf(':'); if (sep > 0 && sep < headerLine.length() - 1) { final String key = headerLine.substring(0, sep).trim(); final Collection<String> value; if (targetMap.containsKey(key)) { value = targetMap.get(key); } else { value = new HashSet<>(); targetMap.put(key, value); } value.add(headerLine.substring(sep + 1, headerLine.length()).trim()); } } }
ODataBatchUtilities { public static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap) { final int sep = headerLine.indexOf(':'); if (sep > 0 && sep < headerLine.length() - 1) { final String key = headerLine.substring(0, sep).trim(); final Collection<String> value; if (targetMap.containsKey(key)) { value = targetMap.get(key); } else { value = new HashSet<>(); targetMap.put(key, value); } value.add(headerLine.substring(sep + 1, headerLine.length()).trim()); } }  }
ODataBatchUtilities { public static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap) { final int sep = headerLine.indexOf(':'); if (sep > 0 && sep < headerLine.length() - 1) { final String key = headerLine.substring(0, sep).trim(); final Collection<String> value; if (targetMap.containsKey(key)) { value = targetMap.get(key); } else { value = new HashSet<>(); targetMap.put(key, value); } value.add(headerLine.substring(sep + 1, headerLine.length()).trim()); } }  static String readBatchPart(final ODataBatchController batchController, final boolean checkCurrent); static String readBatchPart(final ODataBatchController batchController, final int count); static String readBatchPart(
          final ODataBatchController controller, final OutputStream os, final boolean checkCurrent); static String readBatchPart(
          final ODataBatchController controller, final OutputStream os, final int count, final boolean checkCurrent); static Map<String, Collection<String>> readHeaders(final ODataBatchLineIterator iterator); static void readHeaders(
          final ODataBatchLineIterator iterator, final Map<String, Collection<String>> target); static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap); static String getBoundaryFromHeader(final Collection<String> contentType); static Map.Entry<Integer, String> readResponseLine(final ODataBatchLineIterator iterator); static Map<String, Collection<String>> nextItemHeaders(
          final ODataBatchLineIterator iterator, final String boundary); static BatchItemType getItemType(final Map<String, Collection<String>> headers); }
ODataBatchUtilities { public static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap) { final int sep = headerLine.indexOf(':'); if (sep > 0 && sep < headerLine.length() - 1) { final String key = headerLine.substring(0, sep).trim(); final Collection<String> value; if (targetMap.containsKey(key)) { value = targetMap.get(key); } else { value = new HashSet<>(); targetMap.put(key, value); } value.add(headerLine.substring(sep + 1, headerLine.length()).trim()); } }  static String readBatchPart(final ODataBatchController batchController, final boolean checkCurrent); static String readBatchPart(final ODataBatchController batchController, final int count); static String readBatchPart(
          final ODataBatchController controller, final OutputStream os, final boolean checkCurrent); static String readBatchPart(
          final ODataBatchController controller, final OutputStream os, final int count, final boolean checkCurrent); static Map<String, Collection<String>> readHeaders(final ODataBatchLineIterator iterator); static void readHeaders(
          final ODataBatchLineIterator iterator, final Map<String, Collection<String>> target); static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap); static String getBoundaryFromHeader(final Collection<String> contentType); static Map.Entry<Integer, String> readResponseLine(final ODataBatchLineIterator iterator); static Map<String, Collection<String>> nextItemHeaders(
          final ODataBatchLineIterator iterator, final String boundary); static BatchItemType getItemType(final Map<String, Collection<String>> headers);  }