All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.rxjava.ext.web.LanguageHeader Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.rxjava.ext.web;

import rx.Observable;
import rx.Single;
import io.vertx.rx.java.RxHelper;
import io.vertx.rx.java.WriteStreamSubscriber;
import io.vertx.rx.java.SingleOnSubscribeAdapter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;

/**
 * A parsed language header.
 * Delivers a more direct access to the individual elements of the header it represents
 *
 * 

* NOTE: This class has been automatically generated from the {@link io.vertx.ext.web.LanguageHeader original} non RX-ified interface using Vert.x codegen. */ @RxGen(io.vertx.ext.web.LanguageHeader.class) public class LanguageHeader implements io.vertx.rxjava.ext.web.ParsedHeaderValue { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LanguageHeader that = (LanguageHeader) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final TypeArg __TYPE_ARG = new TypeArg<>( obj -> new LanguageHeader((io.vertx.ext.web.LanguageHeader) obj), LanguageHeader::getDelegate ); private final io.vertx.ext.web.LanguageHeader delegate; public LanguageHeader(io.vertx.ext.web.LanguageHeader delegate) { this.delegate = delegate; } public LanguageHeader(Object delegate) { this.delegate = (io.vertx.ext.web.LanguageHeader)delegate; } public io.vertx.ext.web.LanguageHeader getDelegate() { return delegate; } /** * Contains the raw value that was received from the user agent * @return */ public String rawValue() { String ret = delegate.rawValue(); return ret; } /** * Holds the unparsed value of the header.
* For the most part, this is the content before the semi-colon (";") * @return */ public String value() { String ret = delegate.value(); return ret; } /** * Holds the weight specified in the "q" parameter of the header.
* If the parameter is not specified, 1.0 is assumed according to * rfc7231 * @return */ public float weight() { float ret = delegate.weight(); return ret; } /** * The value of the parameter specified by this key. Each is one of 3 things: *

    *
  1. null <- That key was not specified
  2. *
  3. ParsedHeaderValue.EMPTY (tested using ==) <- The value was not specified
  4. *
  5. [Other] <- The value of the parameter
  6. *
* Note: The q parameter is never present. * @param key * @return */ public String parameter(String key) { String ret = delegate.parameter(key); return ret; } /** * The parameters specified in this header value. * Note: The q parameter is never present. * @return Unmodifiable Map of parameters of this header value */ public java.util.Map parameters() { java.util.Map ret = delegate.parameters(); return ret; } /** * Is this an allowed operation as specified by the corresponding header? * @return */ public boolean isPermitted() { boolean ret = delegate.isPermitted(); return ret; } /** * Test if this header is matched by matchTry header * @param matchTry The header to be matched from * @return true if this header represents a subset of matchTry, otherwise, false */ public boolean isMatchedBy(io.vertx.rxjava.ext.web.ParsedHeaderValue matchTry) { boolean ret = delegate.isMatchedBy(matchTry.getDelegate()); return ret; } /** * An integer that represents the absolute order position of this header * @return */ public int weightedOrder() { int ret = delegate.weightedOrder(); return ret; } /** * The tag of the language as specified by * rfc7231#section-3.1.3.1.
* Equivalent to * @return The language tag */ public String tag() { String ret = delegate.tag(); return ret; } /** * The subtag of the language as specified by * rfc7231#section-3.1.3.1.
* Equivalent to * @return The language subtag */ public String subtag() { String ret = delegate.subtag(); return ret; } /** * A subtag of this language header.
* + info: rfc7231#section-3.1.3.1 * @param level * @return The language subtag at specified position */ public String subtag(int level) { String ret = delegate.subtag(level); return ret; } /** * @return the number of subtags this value has */ public int subtagCount() { int ret = delegate.subtagCount(); return ret; } /** * If no "q" parameter is present, the default weight is 1. */ public static final float DEFAULT_WEIGHT = io.vertx.ext.web.LanguageHeader.DEFAULT_WEIGHT; public static LanguageHeader newInstance(io.vertx.ext.web.LanguageHeader arg) { return arg != null ? new LanguageHeader(arg) : null; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy