Class CoreUtils
java.lang.Object
es.kukenan.smartfi.microservice.smartficore.util.CoreUtils
smartfi-core utilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DateTimeFormattersmartfi-core date TIME format.private static final StringEmpty date token.private static final StringISO 8601 date format. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckShouldNotCoreEndpoints(String uriPath, String pattern) Check endpoints belongs to Core endpoints and filter depends uri.static StringFormat sql for date param fields.static LocalDategetLocalDate(String str) Return theLocalDatecorresponding to the given date string in smartfi-core DB format.static StringgetPastDateFromToday(int calendarField, int number) Get date from calendar fields for today.static ZonedDateTimegetZoneDateTime(String str) Return theTimestampcorresponding to the given date string in smartfi-core DB format.
-
Field Details
-
DATETIME_FORMAT
smartfi-core date TIME format. -
ISO_8601_DATE_FORMAT
ISO 8601 date format.- See Also:
-
EMPTY_DATE
Empty date token.- See Also:
-
-
Constructor Details
-
CoreUtils
private CoreUtils()Hide constructor.
-
-
Method Details
-
getZoneDateTime
Return theTimestampcorresponding to the given date string in smartfi-core DB format.- Parameters:
str- the given date string in smartfi-core DB format.- Returns:
- the
Date.
-
getLocalDate
Return theLocalDatecorresponding to the given date string in smartfi-core DB format.- Parameters:
str- the given date string in smartfi-core DB format.- Returns:
- the
LocalDate.
-
formatDateParamForQuery
Format sql for date param fields.- Parameters:
date- as param- Returns:
- the date formatted for sql sentence
-
getPastDateFromToday
Get date from calendar fields for today.- Parameters:
calendarField- type of date (YEAR, DAYS, etc)number- number of calendar fields- Returns:
- date in ISO 8601 format (yyyy-MM-dd)
-
checkShouldNotCoreEndpoints
Check endpoints belongs to Core endpoints and filter depends uri.- Parameters:
uriPath- Uri with endpoint to evaluate.pattern- pattern for evaluate uri.- Returns:
- boolean true belongs to Core endpoints, false not belongs to Core endpoints.
-