Klasse GlobalStringHelper

java.lang.Object
ch.nolix.core.commontype.commontypehelper.GlobalStringHelper

public final class GlobalStringHelper extends Object
The GlobalStringHelper provides methods to handle Strings. Of the GlobalStringHelper an instance cannot be created.
Autor:
Silvan Wyss
  • Methodendetails

    • createStringWithLength

      public static String createStringWithLength(String string, int length)
      Parameter:
      string -
      length -
      Gibt zurück:
      a new String that is the given string extended to the given length with spaces.
      Löst aus:
      ArgumentIsNullException - if the given string is null.
      NegativeArgumentException - if the given length is negative.
      InvalidArgumentException - if the given string is longer than the given length.
    • createStringWithoutLastCharacters

      public static String createStringWithoutLastCharacters(String string, int n)
      Parameter:
      string -
      n -
      Gibt zurück:
      a new String that is like the given string without the last n characters.
    • createTabulators

      public static String createTabulators(int tabulatorCount)
      Parameter:
      tabulatorCount -
      Gibt zurück:
      a new String consisting of as many tabulators as the given tabulatorCount says.
      Löst aus:
      NegativeArgumentException - if the given tabulatorCount is negative.
    • getInBraces

      public static String getInBraces(String string)
      Parameter:
      string -
      Gibt zurück:
      the given string in braces.
      Löst aus:
      ArgumentIsNullException - if the given string is null.
    • getInParantheses

      public static String getInParantheses(String string)
      Parameter:
      string -
      Gibt zurück:
      the given string in parentheses.
      Löst aus:
      ArgumentIsNullException - if the given string is null.
    • getInQuotes

      public static String getInQuotes(String string)
      Parameter:
      string -
      Gibt zurück:
      the given string in quotes
      Löst aus:
      ArgumentIsNullException - if the given string is null.
    • isLowerCase

      public static boolean isLowerCase(String string)
      Parameter:
      string -
      Gibt zurück:
      true if the given string is in lower case.
    • isPascalCase

      public static boolean isPascalCase(String string)
      Parameter:
      string -
      Gibt zurück:
      true if the given string is in pascal case.
    • startsWithIgnoringCase

      public static boolean startsWithIgnoringCase(String string, String prefix)
      Parameter:
      string -
      prefix -
      Gibt zurück:
      true if the given string starts with the given prefix ignoring case.
    • toBoolean

      public static boolean toBoolean(String string)
      Parameter:
      string -
      Gibt zurück:
      the boolean the given string represents.
      Löst aus:
      InvalidArgumentException - if the given string does not represent a boolean.
    • toDouble

      public static double toDouble(String string)
      Parameter:
      string -
      Gibt zurück:
      the double the given string represents.
      Löst aus:
      InvalidArgumentException - if the given string does not represent a double.
    • toPascalCase

      public static String toPascalCase(String string)
      Parameter:
      string -
      Gibt zurück:
      a new String in pascal case for the given string.
    • toUpperSnakeCase

      public static String toUpperSnakeCase(String string)
      Parameter:
      string -
      Gibt zurück:
      a new String in capital snake case for the given string.