@Test public void expires() throws Exception { HashResponseHeaders h = new HashResponseHeaders(null); ZonedDateTime now = ZonedDateTime.now(); h.expires(now); assertThat(h.expires().orElse(null), is(now.truncatedTo(ChronoUnit.SECONDS).withFixedOffsetZone())); h.expires((ZonedDateTime) null); assertThat(h.expires().isPresent(), is(false)); Instant instant = Instant.now(); h.expires(instant); assertThat(h.expires().map(ZonedDateTime::toInstant).orElse(null), is(instant.truncatedTo(ChronoUnit.SECONDS))); }
@Override public Optional<ZonedDateTime> expires() { return first(Http.Header.EXPIRES).map(Http.DateTime::parse); }
HashResponseHeaders extends HashParameters implements ResponseHeaders { @Override public Optional<ZonedDateTime> expires() { return first(Http.Header.EXPIRES).map(Http.DateTime::parse); } }
HashResponseHeaders extends HashParameters implements ResponseHeaders { @Override public Optional<ZonedDateTime> expires() { return first(Http.Header.EXPIRES).map(Http.DateTime::parse); } HashResponseHeaders(BareResponse bareResponse); }
HashResponseHeaders extends HashParameters implements ResponseHeaders { @Override public Optional<ZonedDateTime> expires() { return first(Http.Header.EXPIRES).map(Http.DateTime::parse); } HashResponseHeaders(BareResponse bareResponse); @Override List<MediaType> acceptPatches(); @Override void addAcceptPatches(MediaType... acceptableMediaTypes); @Override Optional<MediaType> contentType(); @Override void contentType(MediaType contentType); @Override OptionalLong contentLength(); @Override void contentLength(long contentLength); @Override Optional<ZonedDateTime> expires(); @Override void expires(ZonedDateTime dateTime); @Override void expires(Instant dateTime); @Override Optional<ZonedDateTime> lastModified(); @Override void lastModified(ZonedDateTime dateTime); @Override void lastModified(Instant dateTime); @Override Optional<URI> location(); @Override void location(URI location); @Override void addCookie(String name, String value); @Override void addCookie(String name, String value, Duration maxAge); @Override void addCookie(SetCookie cookie); @Override boolean equals(Object o); @Override int hashCode(); @Override List<String> put(String key, String... values); @Override List<String> put(String key, Iterable<String> values); @Override List<String> putIfAbsent(String key, String... values); @Override List<String> putIfAbsent(String key, Iterable<String> values); @Override List<String> computeIfAbsent(String key, Function<String, Iterable<String>> values); @Override List<String> computeSingleIfAbsent(String key, Function<String, String> value); @Override void putAll(Parameters parameters); @Override void add(String key, String... values); @Override void add(String key, Iterable<String> values); @Override void addAll(Parameters parameters); @Override List<String> remove(String key); @Override void beforeSend(Consumer<ResponseHeaders> headersConsumer); @Override Single<ResponseHeaders> whenSent(); @Override Single<ResponseHeaders> send(); }
HashResponseHeaders extends HashParameters implements ResponseHeaders { @Override public Optional<ZonedDateTime> expires() { return first(Http.Header.EXPIRES).map(Http.DateTime::parse); } HashResponseHeaders(BareResponse bareResponse); @Override List<MediaType> acceptPatches(); @Override void addAcceptPatches(MediaType... acceptableMediaTypes); @Override Optional<MediaType> contentType(); @Override void contentType(MediaType contentType); @Override OptionalLong contentLength(); @Override void contentLength(long contentLength); @Override Optional<ZonedDateTime> expires(); @Override void expires(ZonedDateTime dateTime); @Override void expires(Instant dateTime); @Override Optional<ZonedDateTime> lastModified(); @Override void lastModified(ZonedDateTime dateTime); @Override void lastModified(Instant dateTime); @Override Optional<URI> location(); @Override void location(URI location); @Override void addCookie(String name, String value); @Override void addCookie(String name, String value, Duration maxAge); @Override void addCookie(SetCookie cookie); @Override boolean equals(Object o); @Override int hashCode(); @Override List<String> put(String key, String... values); @Override List<String> put(String key, Iterable<String> values); @Override List<String> putIfAbsent(String key, String... values); @Override List<String> putIfAbsent(String key, Iterable<String> values); @Override List<String> computeIfAbsent(String key, Function<String, Iterable<String>> values); @Override List<String> computeSingleIfAbsent(String key, Function<String, String> value); @Override void putAll(Parameters parameters); @Override void add(String key, String... values); @Override void add(String key, Iterable<String> values); @Override void addAll(Parameters parameters); @Override List<String> remove(String key); @Override void beforeSend(Consumer<ResponseHeaders> headersConsumer); @Override Single<ResponseHeaders> whenSent(); @Override Single<ResponseHeaders> send();  }