public final class ElasticsearchDateConverter extends Object
Modifier and Type | Method and Description |
---|---|
String |
format(Date date)
Formats the given
TemporalAccessor int a String |
String |
format(TemporalAccessor accessor)
Formats the given
TemporalAccessor into a String. |
static ElasticsearchDateConverter |
of(DateFormat dateFormat)
Creates an ElasticsearchDateConverter for the given
DateFormat . |
static ElasticsearchDateConverter |
of(String pattern)
Creates an ElasticsearchDateConverter for the given pattern.
|
Date |
parse(String input)
Parses a String into a Date.
|
<T extends TemporalAccessor> |
parse(String input,
Class<T> type)
Parses a String into a TemporalAccessor.
|
public static ElasticsearchDateConverter of(DateFormat dateFormat)
DateFormat
.dateFormat
- must not be @{literal null}public static ElasticsearchDateConverter of(String pattern)
pattern
- must not be nullpublic String format(TemporalAccessor accessor)
TemporalAccessor
into a String.accessor
- must not be nullpublic String format(Date date)
TemporalAccessor
int a Stringdate
- must not be nullpublic <T extends TemporalAccessor> T parse(String input, Class<T> type)
T
- the class of typeinput
- the String to parse, must not be null.type
- the class to returnCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.