public class IsoTimestamp extends Object
OffsetDateTime, which represents an instant with the offset from UTC/Greenwich. OffsetDateTime has a
well-defined ordering and thus is more suitable to be persisted; the ZonedDateTime has built-in support for
time zone rules (e.g., daylight savings time and other anomalies) and therefore does not have a well-defined ordering.
Typically, an OffsetDateTime that is read from a persisted state can be converted to a ZonedDateTime
or other time representations for a specific time zone with proper time zone handling, including handling daylight savings
time.
The encoded representation is the UFT-8 byte representation of an ISO8601 string.
| Modifier and Type | Field and Description |
|---|---|
private static Charset |
CHARSET |
private static DateTimeFormatter |
FORMATTER |
static String |
LOGICAL_NAME |
| Constructor and Description |
|---|
IsoTimestamp() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kafka.connect.data.SchemaBuilder |
builder()
Returns a
SchemaBuilder for an IsoTimestamp. |
static byte[] |
fromLogical(org.apache.kafka.connect.data.Schema schema,
OffsetDateTime value)
Convert a value from its logical format (
OffsetDateTime) to it's encoded format. |
static org.apache.kafka.connect.data.Schema |
schema()
Returns a Schema for an IsoTimestamp but with all other default Schema settings.
|
static OffsetDateTime |
toLogical(org.apache.kafka.connect.data.Schema schema,
byte[] value)
Convert a value from its encoded format into its logical format (
OffsetDateTime). |
private static final DateTimeFormatter FORMATTER
private static final Charset CHARSET
public static final String LOGICAL_NAME
public static org.apache.kafka.connect.data.SchemaBuilder builder()
SchemaBuilder for an IsoTimestamp. You can use the resulting SchemaBuilder
to set additional schema settings such as required/optional, default value, and documentation.public static org.apache.kafka.connect.data.Schema schema()
builder()public static byte[] fromLogical(org.apache.kafka.connect.data.Schema schema,
OffsetDateTime value)
OffsetDateTime) to it's encoded format.schema - the schemavalue - the logical valuepublic static OffsetDateTime toLogical(org.apache.kafka.connect.data.Schema schema, byte[] value)
OffsetDateTime).schema - the schemavalue - the encoded valueCopyright © 2016 JBoss by Red Hat. All rights reserved.