Class StubConfiguration
- java.lang.Object
-
- org.springframework.cloud.contract.stubrunner.StubConfiguration
-
public class StubConfiguration extends Object
Represents a configuration of a single stub. The stub can be described by groupId:artifactId:version:classifier notation- Author:
- Marcin Grzejszczak
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CLASSIFIERDefault classifier for the stubs.
-
Constructor Summary
Constructors Constructor Description StubConfiguration(String stubPath)StubConfiguration(String stubPath, String defaultClassifier)StubConfiguration(String groupId, String artifactId, String version)StubConfiguration(String groupId, String artifactId, String version, String classifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetArtifactId()StringgetClassifier()StringgetGroupId()StringgetVersion()booleangroupIdAndArtifactMatches(String ivyNotationAsString)Checks if ivy notation matches group and artifact ids.inthashCode()booleanisVersionChanging()booleanmatchesIvyNotation(String ivyNotationAsString)StringtoColonSeparatedDependencyNotation()StringtoString()
-
-
-
Field Detail
-
DEFAULT_CLASSIFIER
public static final String DEFAULT_CLASSIFIER
Default classifier for the stubs.- See Also:
- Constant Field Values
-
-
Method Detail
-
toColonSeparatedDependencyNotation
public String toColonSeparatedDependencyNotation()
- Returns:
- a colon separated representation of the stub configuration (e.g. groupid:artifactid:version:classifier)
-
groupIdAndArtifactMatches
public boolean groupIdAndArtifactMatches(String ivyNotationAsString)
Checks if ivy notation matches group and artifact ids.- Parameters:
ivyNotationAsString- - e.g. group:artifact:version:classifier- Returns:
trueif artifact id matches and there's no group id. Or if both group id and artifact id are present and matching
-
isVersionChanging
public boolean isVersionChanging()
- Returns:
truefor a snapshot or a LATEST (+) version.
-
getGroupId
public String getGroupId()
-
getArtifactId
public String getArtifactId()
-
getClassifier
public String getClassifier()
-
getVersion
public String getVersion()
-
matchesIvyNotation
public boolean matchesIvyNotation(String ivyNotationAsString)
-
-