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
022import org.apache.juneau.commons.http.*;
023
024
025/**
026 * Represents an HTTP <c>Accept-Language</c> header.
027 *
028 * <p>
029 * Acceptable languages for the response.
030 *
031 * @since 9.2.1
032 */
033public class AcceptLanguage extends HttpStringRangesHeader {
034
035   public static final String NAME = "Accept-Language";
036
037   public AcceptLanguage(String value) {
038      super(NAME, value);
039   }
040
041   public AcceptLanguage(StringRanges value) {
042      super(NAME, value);
043   }
044
045   private AcceptLanguage(Supplier<?> supplier, int lazyMode) {
046      super(NAME, supplier, lazyMode);
047   }
048
049   public static AcceptLanguage of(String value) {
050      return new AcceptLanguage(value);
051   }
052
053   public static AcceptLanguage of(StringRanges value) {
054      return new AcceptLanguage(value);
055   }
056
057   public static AcceptLanguage ofLazyWire(Supplier<String> supplier) {
058      return new AcceptLanguage(supplier, LAZY_WIRE_STRING);
059   }
060
061   public static AcceptLanguage ofLazyParsed(Supplier<StringRanges> supplier) {
062      return new AcceptLanguage(supplier, LAZY_STRING_RANGES);
063   }
064}