Class StringsKt

  • All Implemented Interfaces:

    
    public final class StringsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static String eol
      private final static Set<KClass<?>> parsedClasses
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getEol() Runtime specific end of line.
      final Set<KClass<?>> getParsedClasses() Supported types for the parseOrNull function.
      final static String filterVars(String $self, Map<?, ?> parameters) Filter the target string substituting each key by its value.
      final static String filter(String $self, String prefix, String suffix, Map<String, ?> parameters) TODO.
      final static String encodeToBase64(ByteArray $self) Encode the content of this byteArray to base64.
      final static String encodeToBase64(String $self) Encode this string to base64.
      final static ByteArray decodeBase64(String $self) Decode this base64 encoded string.
      final static <T extends Any> T parse(String $self, KClass<T> type) TODO.
      final static <T extends Any> T parseOrNull(String $self, KClass<T> type) TODO.
      final static String stripAnsi(String $self)
      final static InputStream toStream(String $self) TODO.
      final static String prependIndent(String $self, Integer count, String pad) TODO.
      final static <T extends Enum<?>> T toEnum(String $self, Function1<String, T> converter) TODO.
      final static <T extends Enum<?>> T toEnumOrNull(String $self, Function1<String, T> converter) TODO.
      final static List<MatchGroup> findGroups(Regex $self, String text) TODO.
      final static String banner(String $self, String bannerDelimiter) Format the string as a banner with a delimiter above and below text.
      final static String stripAccents(String $self) TODO.
      final static String utf8(Integer bytes) TODO.
      final static String toEnumValue(String $self)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getEol

         final String getEol()

        Runtime specific end of line.

      • getParsedClasses

         final Set<KClass<?>> getParsedClasses()

        Supported types for the parseOrNull function.

      • filterVars

         final static String filterVars(String $self, Map<?, ?> parameters)

        Filter the target string substituting each key by its value. The keys format resembles Mustache's one: {{key}} and all occurrences are replaced by the supplied value.

        If a variable does not have a parameter, it is left as it is.

        Parameters:
        parameters - The map with the list of key/value tuples.
        Returns:

        The filtered text or the same string if no values are passed or found in the text.

      • filter

         final static String filter(String $self, String prefix, String suffix, Map<String, ?> parameters)
        Parameters:
        prefix - .
        suffix - .
        parameters - .
        Returns:

        .

      • encodeToBase64

         final static String encodeToBase64(ByteArray $self)

        Encode the content of this byteArray to base64.

        Returns:

        The base64 encoded string.

      • encodeToBase64

         final static String encodeToBase64(String $self)

        Encode this string to base64.

        Returns:

        The base64 encoded string.

      • decodeBase64

         final static ByteArray decodeBase64(String $self)

        Decode this base64 encoded string.

        Returns:

        The ByteArray result of decoding the base64 string.

      • parse

         final static <T extends Any> T parse(String $self, KClass<T> type)
        Parameters:
        type - .
        Returns:

        .

      • parseOrNull

         final static <T extends Any> T parseOrNull(String $self, KClass<T> type)
        Parameters:
        type - .
        Returns:

        .

      • stripAnsi

         final static String stripAnsi(String $self)
      • toStream

         final static InputStream toStream(String $self)
        Returns:

        .

      • prependIndent

         final static String prependIndent(String $self, Integer count, String pad)
        Parameters:
        count - .
        pad - .
        Returns:

        .

      • toEnum

         final static <T extends Enum<?>> T toEnum(String $self, Function1<String, T> converter)
        Parameters:
        converter - .
        Returns:

        .

      • toEnumOrNull

         final static <T extends Enum<?>> T toEnumOrNull(String $self, Function1<String, T> converter)
        Parameters:
        converter - .
        Returns:

        .

      • findGroups

         final static List<MatchGroup> findGroups(Regex $self, String text)
        Parameters:
        text - .
        Returns:

        .

      • banner

         final static String banner(String $self, String bannerDelimiter)

        Format the string as a banner with a delimiter above and below text. The character used to render the delimiter is defined.

        Parameters:
        bannerDelimiter - Delimiter char for banners.
      • utf8

         final static String utf8(Integer bytes)
        Parameters:
        bytes - .
        Returns:

        .

      • toEnumValue

         final static String toEnumValue(String $self)