com.hltech.pact.gen.domain.client.util.RawHeadersParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pact-gen Show documentation
Show all versions of pact-gen Show documentation
Automated generation of pact files
The newest version!
package com.hltech.pact.gen.domain.client.util;
import com.hltech.pact.gen.domain.client.model.Param;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public final class RawHeadersParser {
private RawHeadersParser() {}
public static List parseAll(String[] stringHeaderArray) {
return Arrays.stream(stringHeaderArray)
.map(stringHeader -> stringHeader.split("=", 2))
.map(RawHeadersParser::parse)
.collect(Collectors.toList());
}
private static Param parse(String[] stringHeaderArray) {
return Param.builder()
.name(stringHeaderArray[0])
.defaultValue(stringHeaderArray[1])
.build();
}
}