Class Helper

java.lang.Object
ch.bztf.m226blb1.Utils.Helper

public class Helper extends Object
Helper class for the project. Contains some useful methods.
  • Method Details

    • trimToSize

      public static String trimToSize(String value, @Min(3L) @javax.validation.constraints.Min(3L) int size)
      Trims the given string to the given length, appending ... if the string is longer than the given length.
      Parameters:
      value - the value to be checked
      size - the size of the string (greater than 3)
      Returns:
      the trimmed value if it is longer than size, otherwise the original value
    • toUpperCaseNullable

      public static String toUpperCaseNullable(@Nullable String value)
      Converts the given string to a upper case string.
      Parameters:
      value - the value to be converted
      Returns:
      the upper case string or null if the value is null
      Implementation Requirements:
      It can handle null values
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String value, String other)
      Compares the given strings for equality while ignoring the case.
      Parameters:
      value - the first value to be compared
      other - the second value to be compared
      Returns:
      true if the given strings are equal, ignoring the case
      See Also: