Package io.jenkins.plugins.dotnet
Interface DotNetUtils
public interface DotNetUtils
Utility methods used by the plugin.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VariableResolver<String>A string variable resolver that does not resolve any variables. -
Method Summary
Static MethodsModifier and TypeMethodDescriptioncreatePropertyMap(String propertyString) Creates a property map based on a string containing property assignments.static StringcreatePropertyString(Map<String, String> propertyMap) Creates a string containing property assignments based on a property map.static Stringdetokenize(char delimiter, String token) Performs the inverse operation oftokenize(String)for a single token.static Stringdetokenize(char delimiter, String... tokens) Performs the inverse operation oftokenize(String).static <T extends ConsoleNote<?>>
byte[]encodeNote(Supplier<T> createInstance) Creates an instance of aConsoleNoteand encodes it as bytes.static ListBoxModelgetStringCredentialsList(boolean allowEmpty) Fills a listbox model with all available string credentials.static StringTokenizes text separated by (default) delimiters and returns the sole resulting token.static StringsingleToken(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- WhenpropertyStringcould 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
nullwhen 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
nullwhen no tokens were provided.
-
encodeNote
Creates an instance of aConsoleNoteand 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, ornullwhen 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, ornullwhen 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, ornullwhen 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, ornullwhen it did not contain any. - See Also:
-