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.util.function.*;
021
022/**
023 * Represents an HTTP <c>Age</c> header.
024 *
025 * <p>
026 * The age the object has been in a proxy cache in seconds.
027 *
028 * @since 9.2.1
029 */
030public class Age extends HttpIntegerHeader {
031
032   public static final String NAME = "Age";
033
034   public Age(String value) {
035      super(NAME, value);
036   }
037
038   public Age(int value) {
039      super(NAME, Integer.valueOf(value));
040   }
041
042   public Age(Integer value) {
043      super(NAME, value);
044   }
045
046   private Age(Supplier<?> supplier, int lazyMode) {
047      super(NAME, supplier, lazyMode);
048   }
049
050   public static Age of(String value) {
051      return new Age(value);
052   }
053
054   public static Age of(int value) {
055      return new Age(value);
056   }
057
058   public static Age of(Integer value) {
059      return new Age(value);
060   }
061
062   public static Age ofLazyWire(Supplier<String> supplier) {
063      return new Age(supplier, LAZY_WIRE_STRING);
064   }
065
066   public static Age ofLazyParsed(Supplier<Integer> supplier) {
067      return new Age(supplier, LAZY_INTEGER);
068   }
069}