001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 (the 006 * "License"); you may not use this file except in compliance with the 007 * License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.http.header; 018 019 020import java.time.*; 021import java.util.function.*; 022 023/** 024 * Represents an HTTP <c>Expires</c> header. 025 * 026 * <p> 027 * The date/time after which the response is considered stale. 028 * 029 * @since 9.2.1 030 */ 031public class Expires extends HttpDateHeader { 032 033 public static final String NAME = "Expires"; 034 035 public Expires(String value) { 036 super(NAME, value); 037 } 038 039 public Expires(ZonedDateTime value) { 040 super(NAME, value); 041 } 042 043 private Expires(Supplier<?> supplier, int lazyMode) { 044 super(NAME, supplier, lazyMode); 045 } 046 047 public static Expires of(String value) { 048 return new Expires(value); 049 } 050 051 public static Expires of(ZonedDateTime value) { 052 return new Expires(value); 053 } 054 055 public static Expires ofLazyWire(Supplier<String> supplier) { 056 return new Expires(supplier, LAZY_WIRE_STRING); 057 } 058 059 public static Expires ofLazyParsed(Supplier<ZonedDateTime> supplier) { 060 return new Expires(supplier, LAZY_ZONED_DATE_TIME); 061 } 062}