Class ConverterUtil

java.lang.Object
com.github.hypfvieh.util.ConverterUtil

public final class ConverterUtil extends Object
Utility class for converting types (e.g. String to Integer).
Since:
v1.0 - 2016-07-08
Author:
hypfvieh
  • Method Details

    • strToInt

      public static Integer strToInt(String _str, Integer _default)
      Convert given String to Integer, returns _default if String is not an integer.
      Parameters:
      _str -
      _default -
      Returns:
      _str as Integer or _default value
    • strToInt

      public static Integer strToInt(String _str)
      Convert given String to Integer, returns null if String is not an integer.
      Parameters:
      _str -
      Returns:
      _str as Integer or null
    • strToBool

      public static boolean strToBool(String _str)
      Returns true if string matches certain boolean values.
      Parameters:
      _str -
      Returns:
    • toProperties

      public static Properties toProperties(Map<?,?> _map)
      Convertes a map to a Properties object.
      Parameters:
      _map -
      Returns:
      Properties object