Klasse 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).
Seit:
v1.0 - 2016-07-08
Autor:
hypfvieh
  • Methodendetails

    • strToInt

      public static Integer strToInt(String _str, Integer _default)
      Convert given String to Integer, returns _default if String is not an integer.
      Parameter:
      _str -
      _default -
      Gibt zurück:
      _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.
      Parameter:
      _str -
      Gibt zurück:
      _str as Integer or null
    • strToBool

      public static boolean strToBool(String _str)
      Returns true if string matches certain boolean values.
      Parameter:
      _str -
      Gibt zurück:
    • toProperties

      public static Properties toProperties(Map<?,?> _map)
      Convertes a map to a Properties object.
      Parameter:
      _map -
      Gibt zurück:
      Properties object
    • toLocalDateTime

      public static LocalDateTime toLocalDateTime(Date _date)
      Converts a Date to a LocalDateTime using the default timezone.
      Parameter:
      _date - date to convert
      Gibt zurück:
      LocalDateTime or null if input null
    • toLocalDate

      public static LocalDate toLocalDate(Date _date)
      Converts a Date to a LocalDate using the default timezone.
      Parameter:
      _date - date to convert
      Gibt zurück:
      LocalDate or null if input null
    • toLocalTime

      public static LocalTime toLocalTime(Date _date)
      Converts a Date to a LocalTime using the default timezone.
      Parameter:
      _date - date to convert
      Gibt zurück:
      LocalTime or null if input null