Class StubsParser
- java.lang.Object
-
- org.springframework.cloud.contract.stubrunner.util.StubsParser
-
public final class StubsParser extends Object
Utility to parse string into a list of configuration of stubs.- Author:
- Marcin Grzejszczak
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<StubConfiguration>fromString(Collection<String> collection, String defaultClassifier)The string is expected to be a map with entry called "stubs" that contains a list of Strings in the format groupid:artifactid:version:classifier:port groupid:artifactid:version:classifier groupid:artifactid:version groupid:artifactid In the latter case the provided default stub classifier will be passed.static Map<StubConfiguration,Integer>fromStringWithPort(String notation)static booleanhasPort(String id)static StringivyFromStringWithPort(String notation)
-
-
-
Method Detail
-
fromString
public static List<StubConfiguration> fromString(Collection<String> collection, String defaultClassifier)
The string is expected to be a map with entry called "stubs" that contains a list of Strings in the format- groupid:artifactid:version:classifier:port
- groupid:artifactid:version:classifier
- groupid:artifactid:version
- groupid:artifactid
- Parameters:
collection- collection of idsdefaultClassifier- default classifier to append if one is missing- Returns:
- parsed stub configurations
-
fromStringWithPort
public static Map<StubConfiguration,Integer> fromStringWithPort(String notation)
- Parameters:
notation- ivy notation of stubs with ports- Returns:
- mapping of parsed stub configurations to ports on which the stub is running
-
ivyFromStringWithPort
public static String ivyFromStringWithPort(String notation)
- Parameters:
notation- ivy notation of stubs with ports- Returns:
- colon seprated dependency notation with port or empty string if no port is present
-
hasPort
public static boolean hasPort(String id)
- Parameters:
id- string notation of a stub- Returns:
trueif a port is there in the identifier
-
-