Interface DotNetUtils


public interface DotNetUtils
Utility methods used by the plugin.
  • Field Details

    • RESOLVE_NOTHING

      static final VariableResolver<String> 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 - When propertyString could not be loaded as a set of properties.
    • createPropertyString

      @CheckForNull static String createPropertyString(@CheckForNull Map<String,String> propertyMap) throws IOException
      Creates 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

      @CheckForNull static String detokenize(char delimiter, @CheckForNull String token)
      Performs the inverse operation of tokenize(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

      @CheckForNull static String detokenize(char delimiter, @CheckForNull String... tokens)
      Performs the inverse operation of tokenize(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

      @NonNull static <T extends ConsoleNote<?>> byte[] encodeNote(@NonNull Supplier<T> createInstance)
      Creates an instance of a ConsoleNote 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

      @NonNull static ListBoxModel getStringCredentialsList(boolean allowEmpty)
      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

      @CheckForNull static String singleToken(@CheckForNull String s)
      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, or null when it did not contain exactly one token.
      See Also:
    • singleToken

      @CheckForNull static String singleToken(@CheckForNull String s, @CheckForNull String delimiters)
      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, or null when it did not contain exactly one token.
      See Also:
    • tokenize

      @CheckForNull static String[] tokenize(@CheckForNull String s)
      Tokenizes text separated by (default) delimiters.
      Parameters:
      s - A string containing tokens.
      Returns:
      The tokens contained in s, or null when it did not contain any.
      See Also:
    • tokenize

      @CheckForNull static String[] tokenize(@CheckForNull String s, @CheckForNull String delimiters)
      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, or null when it did not contain any.
      See Also: