Package com.xero.api
Class StringUtil
java.lang.Object
com.xero.api.StringUtil
StringUtil has helper methods for String and Date conversions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsIgnoreCase(String[] array, String value) Check if the given array contains the given value (with case-insensitive comparison).org.threeten.bp.LocalDateconvertStringToDate(String date) Convert string to dateorg.threeten.bp.LocalDateTimeConvert string to datetimeorg.threeten.bp.OffsetDateTimeConvert string to datetimestatic StringJoin an array of strings with the given separator.
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
containsIgnoreCase
-
join
Join an array of strings with the given separator.Note: This might be replaced by utility method from commons-lang or guava someday if one of those libraries is added as dependency.
- Parameters:
array- The array of stringsseparator- The separator- Returns:
- the resulting string
-
convertStringToDate
Convert string to date- Parameters:
date- String is a date in MS DateFormat- Returns:
- LocalDate a standard date
- Throws:
IOException- thown if string pattern matching and formatting fails
-
convertStringToOffsetDateTime
Convert string to datetime- Parameters:
date- String is a date in MS DateFormat- Returns:
- OffsetDateTime an offset date time set to UTC
- Throws:
IOException- thown if string pattern matching and formatting fails
-
convertStringToLocalDateTime
Convert string to datetime- Parameters:
date- String is a date in MS DateFormat- Returns:
- LocalDateTime an local date time
- Throws:
IOException- thown if string pattern matching and formatting fails
-