Class TimeUtil
java.lang.Object
de.fraunhofer.iese.mydata.policy.time.TimeUtil
Operations for ZonedDateTime, Zone and MyDataTimeExpressions
- Author:
- Robin Brandstaedter <Robin.Brandstaedter@iese.fraunhofer.de>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final org.slf4j.Logger
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTime
addDay
(int value, ZonedDateTime aZonedDateTime) static ZonedDateTime
addHours
(int value, ZonedDateTime aZonedDateTime) static ZonedDateTime
addMinutes
(int value, ZonedDateTime aZonedDateTime) static ZonedDateTime
addMonth
(int value, ZonedDateTime aZonedDateTime) static ZonedDateTime
addSeconds
(int value, ZonedDateTime aZonedDateTime) static ZonedDateTime
addYear
(int value, ZonedDateTime aZonedDateTime) static ZonedDateTime
addYear
(String expressionValue, ZonedDateTime aZonedDateTime) static ZonedDateTime
getDynamicZonedDateTime
(Map<String, String> expressionMap, ZonedDateTime timeRelativeTo) getExpressionMap
(String expression) static String
getHighestRelativeChangeUnit
(TimeExpression timeExpression) static TimeInterval
getInterval
(String fixedExpression, ZonedDateTime timeRelativeTo) static TimeInterval
getInterval
(String fixedExpression, ZonedDateTime timeRelativeTo, String sDayOfWeek) static String
getLowestConcreteUnit
(TimeExpression timeExpression) static long
getMillisFromZonedDateTime
(ZonedDateTime zdt, String targetZoneId) static ZonedDateTime
static ZonedDateTime
static int
getValenceOfUnitString
(String unit) static ZonedDateTime
getZonedDateTime
(String dateString, String timezoneid) static ZonedDateTime
getZonedDateTime
(String dateString, ZoneId zoneId) static ZonedDateTime
getZonedDateTime
(Timestamp ts, String timezoneid) static boolean
isValid
(TimeExpression timeExpression) static ZonedDateTime
parseExpressionToZonedDateTime
(String expression, ZonedDateTime timeRelativeTo) Parses the expression and returns the zoned date time.static TimeExpression
static ZonedDateTime
transferToZone
(ZonedDateTime zdt, String timeZoneId) static ZonedDateTime
transferToZone
(ZonedDateTime zdt, ZoneId zoneId)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
NOW
- See Also:
-
YEAR
- See Also:
-
MONTH
- See Also:
-
DAY
- See Also:
-
HOURS
- See Also:
-
MINUTES
- See Also:
-
SECONDS
- See Also:
-
THIS_MINUTE
- See Also:
-
LAST_MINUTE
- See Also:
-
THIS_HOUR
- See Also:
-
LAST_HOUR
- See Also:
-
TODAY
- See Also:
-
YESTERDAY
- See Also:
-
THIS_MONTH
- See Also:
-
LAST_MONTH
- See Also:
-
THIS_YEAR
- See Also:
-
LAST_YEAR
- See Also:
-
ALWAYS
- See Also:
-
THIS_WEEK
- See Also:
-
LAST_WEEK
- See Also:
-
THIS_SUN_WEEK
- See Also:
-
LAST_SUN_WEEK
- See Also:
-
-
Constructor Details
-
TimeUtil
public TimeUtil()
-
-
Method Details
-
parseExpressionToZonedDateTime
public static ZonedDateTime parseExpressionToZonedDateTime(String expression, ZonedDateTime timeRelativeTo) Parses the expression and returns the zoned date time.- Parameters:
expression
- e.g., "10.10.2016 00:00:00", "*.-1.* *:*:*",...timeRelativeTo
- the time relative to now/event- Returns:
- the zoned date time
- Throws:
IllegalArgumentException
- the invalid format exception
-
getInterval
-
getInterval
public static TimeInterval getInterval(String fixedExpression, ZonedDateTime timeRelativeTo, String sDayOfWeek) -
getDynamicZonedDateTime
public static ZonedDateTime getDynamicZonedDateTime(Map<String, String> expressionMap, ZonedDateTime timeRelativeTo) -
addYear
-
addMonth
-
addDay
-
addHours
-
addMinutes
-
addSeconds
-
addYear
-
getExpressionMap
-
splittMap
-
getNow
-
getNow
-
transferToZone
-
transferToZone
-
getHighestRelativeChangeUnit
-
getLowestConcreteUnit
-
getValenceOfUnitString
-
isValid
-
getZonedDateTime
-
getZonedDateTime
-
getZonedDateTime
-
getMillisFromZonedDateTime
-