public class ConfigurationPropertyValidator extends Object
| Modifier and Type | Method and Description |
|---|---|
static ImageReference |
getGeneratedTargetDockerTag(String targetImage,
ProjectProperties projectProperties,
HelpfulSuggestions helpfulSuggestions)
Returns an
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configured |
static Optional<Credential> |
getImageCredential(Consumer<LogEvent> logger,
String usernameProperty,
String passwordProperty,
AuthProperty auth,
RawConfiguration rawConfiguration)
Gets a
Credential from a username and password. |
static List<String> |
parseListProperty(String property)
Parses a comma-separated string into a list.
|
static Map<String,String> |
parseMapProperty(String property)
Parses a string in the form of "key1=value1,key2=value2,..." into a map.
|
public static Optional<Credential> getImageCredential(Consumer<LogEvent> logger, String usernameProperty, String passwordProperty, AuthProperty auth, RawConfiguration rawConfiguration)
Credential from a username and password. First tries system properties, then
tries build configuration, otherwise returns null.logger - a consumer for handling log eventsusernameProperty - the name of the username system propertypasswordProperty - the name of the password system propertyauth - the configured credentialsrawConfiguration - the RawConfiguration that provides system propertiesAuthorization from the system properties or build configuration, or
Optional.empty() if neither is configured.public static ImageReference getGeneratedTargetDockerTag(@Nullable String targetImage, ProjectProperties projectProperties, HelpfulSuggestions helpfulSuggestions) throws InvalidImageReferenceException
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configuredtargetImage - the configured target image referenceprojectProperties - the ProjectProperties providing the project name, version, and
log event handlerhelpfulSuggestions - used for generating the message notifying the user of the generated
tagImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configuredInvalidImageReferenceException - if the configured or generated image reference is
invalidpublic static Map<String,String> parseMapProperty(String property)
property - the map string to parse, with entries separated by "," and key-value pairs
separated by "="Copyright © 2019. All rights reserved.