| Total Complexity | 3 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package com.hltech.pact.gen.domain.client.util; |
||
| 9 | public final class RawHeadersParser { |
||
| 10 | |||
| 11 | private RawHeadersParser() {} |
||
| 12 | |||
| 13 | public static List<Param> parseAll(String[] stringHeaderArray) { |
||
| 14 | return Arrays.stream(stringHeaderArray) |
||
| 15 | .map(stringHeader -> stringHeader.split("=", 2)) |
||
| 16 | .map(RawHeadersParser::parse) |
||
| 17 | .collect(Collectors.toList()); |
||
| 18 | } |
||
| 19 | |||
| 20 | private static Param parse(String[] stringHeaderArray) { |
||
| 21 | return Param.builder() |
||
| 22 | .name(stringHeaderArray[0]) |
||
| 23 | .defaultValue(stringHeaderArray[1]) |
||
| 24 | .build(); |
||
| 25 | } |
||
| 27 |