Class ElasticsearchDateConverter
java.lang.Object
org.springframework.data.elasticsearch.core.convert.ElasticsearchDateConverter
Provides Converter instances to convert to and from Dates in the different date and time formats that elasticsearch
understands.
- Since:
- 4.0
- Author:
- Peter-Josef Meisch
-
Method Summary
Modifier and TypeMethodDescriptionformat(TemporalAccessor accessor) Formats the givenTemporalAccessorinto a String.Formats the givenTemporalAccessorint a Stringstatic ElasticsearchDateConverterCreates an ElasticsearchDateConverter for the given pattern.static ElasticsearchDateConverterof(DateFormat dateFormat) Creates an ElasticsearchDateConverter for the givenDateFormat.Parses a String into a Date.<T extends TemporalAccessor>
TParses a String into a TemporalAccessor.
-
Method Details
-
of
Creates an ElasticsearchDateConverter for the givenDateFormat.- Parameters:
dateFormat- must not be @{literal null}- Returns:
- converter
-
of
Creates an ElasticsearchDateConverter for the given pattern.- Parameters:
pattern- must not be null- Returns:
- converter
-
format
Formats the givenTemporalAccessorinto a String.- Parameters:
accessor- must not be null- Returns:
- the formatted object
-
format
Formats the givenTemporalAccessorint a String- Parameters:
date- must not be null- Returns:
- the formatted object
-
parse
Parses a String into a TemporalAccessor.- Type Parameters:
T- the class of type- Parameters:
input- the String to parse, must not be null.type- the class to return- Returns:
- the new created object
-
parse
Parses a String into a Date.- Parameters:
input- the String to parse, must not be null.- Returns:
- the new created object
-