public static class ValueFormatter.DateTime extends Object implements ValueFormatter
ValueFormatter.BooleanFormatter, ValueFormatter.DateTime, ValueFormatter.GeoHash, ValueFormatter.IPv4Formatter, ValueFormatter.Number, ValueFormatter.Raw
Modifier and Type | Field and Description |
---|---|
static ValueFormatter |
DEFAULT |
BOOLEAN, GEOHASH, IPv4, RAW
Constructor and Description |
---|
ValueFormatter.DateTime(FormatDateTimeFormatter formatter) |
ValueFormatter.DateTime(FormatDateTimeFormatter formatter,
org.joda.time.DateTimeZone timezone) |
ValueFormatter.DateTime(String format) |
ValueFormatter.DateTime(String format,
org.joda.time.DateTimeZone timezone) |
Modifier and Type | Method and Description |
---|---|
String |
format(double value) |
String |
format(long time)
Formats the given millis time value (since the epoch) to string.
|
byte |
id()
Uniquely identifies this formatter (used for efficient serialization)
|
static ValueFormatter.DateTime |
mapper(DateFieldMapper.DateFieldType fieldType,
org.joda.time.DateTimeZone timezone) |
void |
readFrom(StreamInput in) |
void |
writeTo(StreamOutput out) |
public static final ValueFormatter DEFAULT
public ValueFormatter.DateTime(String format)
public ValueFormatter.DateTime(FormatDateTimeFormatter formatter)
public ValueFormatter.DateTime(String format, org.joda.time.DateTimeZone timezone)
public ValueFormatter.DateTime(FormatDateTimeFormatter formatter, org.joda.time.DateTimeZone timezone)
public static ValueFormatter.DateTime mapper(DateFieldMapper.DateFieldType fieldType, org.joda.time.DateTimeZone timezone)
public String format(long time)
ValueFormatter
format
in interface ValueFormatter
time
- The long value to format.public String format(double value)
format
in interface ValueFormatter
value
- double The double value to format.public byte id()
ValueFormatter
id
in interface ValueFormatter
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
Copyright © 2009–2017. All rights reserved.