/** * Parses an {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses an {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
Instant instant = Instant.parse(text);
Instant instant = Instant.parse(text);
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
@Override public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { JsonToken t = p.getCurrentToken(); if (t == JsonToken.VALUE_NUMBER_INT) { return new Instant(p.getLongValue()); } if (t == JsonToken.VALUE_STRING) { String str = p.getText().trim(); if (str.length() == 0) { return null; } // 11-Sep-2018, tatu: `DateTimeDeserializer` allows timezone inclusion in brackets; // should that be checked here too? return Instant.parse(str, _format.createParser(ctxt)); } return _handleNotNumberOrString(p, ctxt); } }
private Instant validateTimestamp(String timestamp) { try { return Instant.parse(timestamp); } catch (Exception e) { String message = "Could not parse result time parameter." + timestamp; throw new IoParseException(message, e); } }
private void updateTime (String time) { Instant value = Instant.parse(time); timeService.setCurrentTime(value); log.debug("time set to " + time); }
public Timestamp(final String value) throws IllegalArgumentException, UnsupportedOperationException { this.timestamp = Instant.parse(value, ISO8601_PARSER); this.value = toString(); }
public Timestamp(final String value) throws IllegalArgumentException, UnsupportedOperationException { this.timestamp = Instant.parse(value, ISO8601_PARSER); this.value = toString(); }
@ProcessElement public void processElement(@Element String input, OutputReceiver<KV<String, Integer>> output) { String[] parts = input.split(","); String team = parts[1].trim(); Integer score = Integer.parseInt(parts[2].trim()); Instant eventTime = Instant.parse(parts[3].trim()); output.outputWithTimestamp(KV.of(team, score), eventTime); } }
@Override public ByteBuffer serialize(String value, ProtocolVersion protocolVersion) { if (value == null) { return null; } if (value.indexOf(' ') == 10 && value.indexOf('Z') < 0) { StringBuilder builder = new StringBuilder(value).append('Z'); builder.setCharAt(10, 'T'); value = builder.toString(); } return bigint().serializeNoBoxing(Instant.parse(value).getMillis(), protocolVersion); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
/** * Parses a {@code Instant} from the specified string. * <p> * This uses {@link ISODateTimeFormat#dateTimeParser()}. * * @param str the string to parse, not null * @since 2.0 */ @FromString public static Instant parse(String str) { return parse(str, ISODateTimeFormat.dateTimeParser()); }
private void truncatedRfc339(String timestamp, String truncatedTimestmap) { assertEquals(Instant.parse(truncatedTimestmap).getMillis(), parse(timestamp)); }