Package io.jenkins.plugins.dotnet
Interface DotNetUtils
public interface DotNetUtils
Utility methods used by the plugin.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final VariableResolver<String>
A string variable resolver that does not resolve any variables. -
Method Summary
Modifier and TypeMethodDescriptioncreatePropertyMap
(String propertyString) Creates a property map based on a string containing property assignments.static String
createPropertyString
(Map<String, String> propertyMap) Creates a string containing property assignments based on a property map.static String
detokenize
(char delimiter, String token) Performs the inverse operation oftokenize(String)
for a single token.static String
detokenize
(char delimiter, String... tokens) Performs the inverse operation oftokenize(String)
.static <T extends ConsoleNote<?>>
byte[]encodeNote
(Supplier<T> createInstance) Creates an instance of aConsoleNote
and encodes it as bytes.static ListBoxModel
getStringCredentialsList
(boolean allowEmpty) Fills a listbox model with all available string credentials.static String
Tokenizes text separated by (default) delimiters and returns the sole resulting token.static String
singleToken
(String s, String delimiters) Tokenizes text separated by delimiters and returns the sole resulting token.static String[]
Tokenizes text separated by (default) delimiters.static String[]
Tokenizes text separated by delimiters.
-
Field Details
-
RESOLVE_NOTHING
A string variable resolver that does not resolve any variables.
-
-
Method Details
-
createPropertyMap
@CheckForNull static Map<String,String> createPropertyMap(@CheckForNull String propertyString) throws IOException Creates a property map based on a string containing property assignments.- Parameters:
propertyString
- A string containing property assignments.- Returns:
- A map of the properties as key/value pairs.
- Throws:
IOException
- WhenpropertyString
could not be loaded as a set of properties.
-
createPropertyString
@CheckForNull static String createPropertyString(@CheckForNull Map<String, String> propertyMap) throws IOExceptionCreates a string containing property assignments based on a property map.- Parameters:
propertyMap
- A map of properties as key/value pairs.- Returns:
- A string containing property assignments.
- Throws:
IOException
- When the properties could not be written as a string.
-
detokenize
Performs the inverse operation oftokenize(String)
for a single token.- Parameters:
delimiter
- The delimiter to use.token
- The token to process.- Returns:
- A single string that tokenizes to the same single token, or
null
when no token was provided were provided.
-
detokenize
Performs the inverse operation oftokenize(String)
.- Parameters:
delimiter
- The delimiter to use.tokens
- The tokens to combine.- Returns:
- A single string that tokenizes to the same set of tokens (with empty entries elided), or
null
when no tokens were provided.
-
encodeNote
Creates an instance of aConsoleNote
and encodes it as bytes.- Type Parameters:
T
- The type of console note to encode.- Parameters:
createInstance
- A means of creating an instance. Typically this will be a constructor reference.- Returns:
- An instance of a console note, encoded as a byte array.
-
getStringCredentialsList
Fills a listbox model with all available string credentials.- Parameters:
allowEmpty
- Indicates whether to include an empty ("no credential selected") option in the listbox.- Returns:
- A suitably filled listbox model.
-
singleToken
Tokenizes text separated by (default) delimiters and returns the sole resulting token.- Parameters:
s
- A string containing tokens.- Returns:
- The sole token contained in
s
, ornull
when it did not contain exactly one token. - See Also:
-
singleToken
Tokenizes text separated by delimiters and returns the sole resulting token.- Parameters:
s
- A string containing tokens.delimiters
- A string containing the delimiters to use.- Returns:
- The sole token contained in
s
, ornull
when it did not contain exactly one token. - See Also:
-
tokenize
Tokenizes text separated by (default) delimiters.- Parameters:
s
- A string containing tokens.- Returns:
- The tokens contained in
s
, ornull
when it did not contain any. - See Also:
-
tokenize
Tokenizes text separated by delimiters.- Parameters:
s
- A string containing tokens.delimiters
- A string containing the delimiters to use.- Returns:
- The tokens contained in
s
, ornull
when it did not contain any. - See Also:
-