java.lang.Object
com.github.hypfvieh.util.ConverterUtil
Utility class for converting types (e.g. String to Integer).
- Seit:
- v1.0 - 2016-07-08
- Autor:
- hypfvieh
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic booleanReturns true if string matches certain boolean values.static IntegerConvert given String to Integer, returns null if String is not an integer.static IntegerConvert given String to Integer, returns _default if String is not an integer.static LocalDatetoLocalDate(Date _date) static LocalDateTimetoLocalDateTime(Date _date) Converts aDateto aLocalDateTimeusing the default timezone.static LocalTimetoLocalTime(Date _date) static PropertiestoProperties(Map<?, ?> _map) Convertes a map to a Properties object.
-
Methodendetails
-
strToInt
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
Convert given String to Integer, returns null if String is not an integer.- Parameter:
_str-- Gibt zurück:
- _str as Integer or null
-
strToBool
Returns true if string matches certain boolean values.- Parameter:
_str-- Gibt zurück:
-
toProperties
Convertes a map to a Properties object.- Parameter:
_map-- Gibt zurück:
- Properties object
-
toLocalDateTime
Converts aDateto aLocalDateTimeusing the default timezone.- Parameter:
_date- date to convert- Gibt zurück:
- LocalDateTime or null if input null
-
toLocalDate
- Parameter:
_date- date to convert- Gibt zurück:
- LocalDate or null if input null
-
toLocalTime
- Parameter:
_date- date to convert- Gibt zurück:
- LocalTime or null if input null
-