public final class Time extends Object
| Modifier and Type | Method and Description |
|---|---|
static OffsetDateTime |
parseTime(String time)
Parse a
String RFC3339 compliant as OffsetDateTime. |
static OffsetDateTime |
parseTime(String attributeName,
String time)
Parse an attribute/extension with RFC3339 compliant
String value as OffsetDateTime. |
static String |
writeTime(OffsetDateTime time)
Convert a
OffsetDateTime to a RFC3339 compliant String. |
static String |
writeTime(String attributeName,
OffsetDateTime time)
Convert an attribute/extension
OffsetDateTime to a RFC3339 compliant String. |
public static OffsetDateTime parseTime(String time) throws DateTimeParseException
String RFC3339 compliant as OffsetDateTime.time - the value to parse as timeOffsetDateTimeDateTimeParseException - if something went wrong when parsing the provided time.public static OffsetDateTime parseTime(String attributeName, String time) throws CloudEventRWException
String value as OffsetDateTime.attributeName - the attribute/extension nametime - the value to parse as timeOffsetDateTimeCloudEventRWException - if something went wrong when parsing the attribute/extension.public static String writeTime(OffsetDateTime time) throws DateTimeException
OffsetDateTime to a RFC3339 compliant String.time - the time to write as StringDateTimeException - if something went wrong when serializing the provided time.public static String writeTime(String attributeName, OffsetDateTime time) throws DateTimeException
OffsetDateTime to a RFC3339 compliant String.attributeName - the attribute/extension nametime - the time to write as StringCloudEventRWException - if something went wrong when serializing the attribute/extension.DateTimeExceptionCopyright © 2022. All rights reserved.