Package com.studerw.tda.parse
Class Utils
java.lang.Object
com.studerw.tda.parse.Utils
Helper class mainly for tests to pretty print JSON, dates, etc.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringepochToStr(Long epoch) static ZonedDateTimefromTdaISO8601(String isoString) static booleanisNullOrEmpty(Collection<?> c) static booleanisNullOrEmpty(Map<?, ?> m) static StringprettyFormat(String input) static StringtoTdaISO8601(ZonedDateTime zonedDateTime) static Stringstatic StringtoTdaYMD(ZonedDateTime zonedDateTime)
-
Field Details
-
TMD
-
ISO
-
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
prettyFormat
- Parameters:
input- json- Returns:
- formatted json (i.e. prettyPrint from Jackson)
-
epochToStr
- Parameters:
epoch- number of milliseconds since epoch- Returns:
- formatted string e.g. January 25, 2019 at 3:55:06 AM CST
-
isNullOrEmpty
- Parameters:
c- collection to check if null or empty- Returns:
- true if null or empty, otherwise false
-
isNullOrEmpty
- Parameters:
m- map to check if null or empty- Returns:
- true if null or empty, otherwise false
-
toTdaISO8601
- Parameters:
zonedDateTime- the date to format- Returns:
- a string formatted like
yyyy-MM-dd'T'HH:mm:ssz.
-
fromTdaISO8601
- Parameters:
isoString- string formatted likeyyyy-MM-dd'T'HH:mm:ssz.- Returns:
- instant
-
toTdaYMD
- Parameters:
zonedDateTime- the date to format- Returns:
- a string formatted like
yyyy-MM-dd.
-
toTdaYMD
- Parameters:
localDate- to convert- Returns:
- a String in form of "yyyy-MM-dd"
-