Module org.elasticsearch.xcore
Class WatcherDateTimeUtils
java.lang.Object
org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTimeconvertToDate(Object value, Clock clock) static StringformatDate(ZonedDateTime date) static ZonedDateTimestatic ZonedDateTimestatic ZonedDateTimeparseDate(String fieldName, XContentParser parser, ZoneId timeZone) static ZonedDateTimeparseDateMath(String valueString, ZoneId timeZone, Clock clock) static ZonedDateTimeparseDateMath(String fieldName, XContentParser parser, ZoneId timeZone, Clock clock) static ZonedDateTimeparseDateMathOrNull(String fieldName, XContentParser parser, ZoneId timeZone, Clock clock) static TimeValueparseTimeValue(XContentParser parser, String settingName) static TimeValueparseTimeValueSupportingFractional(String sValue, String settingName) Parse aTimeValuewith support for fractional values.static ZonedDateTimestatic XContentBuilderwriteDate(String fieldName, XContentBuilder builder, ZonedDateTime date) static voidwriteDate(StreamOutput out, ZonedDateTime date) static voidwriteOptionalDate(StreamOutput out, ZonedDateTime date)
-
Field Details
-
dateTimeFormatter
-
dateMathParser
-
-
Method Details
-
convertToDate
-
parseDate
-
parseDate
-
formatDate
-
parseDateMath
public static ZonedDateTime parseDateMath(String fieldName, XContentParser parser, ZoneId timeZone, Clock clock) throws IOException - Throws:
IOException
-
parseDateMathOrNull
public static ZonedDateTime parseDateMathOrNull(String fieldName, XContentParser parser, ZoneId timeZone, Clock clock) throws IOException - Throws:
IOException
-
parseDateMath
-
parseDate
public static ZonedDateTime parseDate(String fieldName, XContentParser parser, ZoneId timeZone) throws IOException - Throws:
IOException
-
writeDate
public static XContentBuilder writeDate(String fieldName, XContentBuilder builder, ZonedDateTime date) throws IOException - Throws:
IOException
-
writeDate
- Throws:
IOException
-
writeOptionalDate
- Throws:
IOException
-
readOptionalDate
- Throws:
IOException
-
parseTimeValue
public static TimeValue parseTimeValue(XContentParser parser, String settingName) throws IOException - Throws:
IOException
-
parseTimeValueSupportingFractional
public static TimeValue parseTimeValueSupportingFractional(@Nullable String sValue, String settingName) Parse aTimeValuewith support for fractional values.
-