/*
 * 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.reactivex.ext.web;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;

Represents an HTTP Cookie.

All cookies must have a name and a value and can optionally have other fields set such as path, domain, etc.

(Derived from io.netty.handler.codec.http.Cookie)

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * Represents an HTTP Cookie. * <p> * All cookies must have a name and a value and can optionally have other fields set such as path, domain, etc. * <p> * (Derived from io.netty.handler.codec.http.Cookie) * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.ext.web.Cookie original} non RX-ified interface using Vert.x codegen. */
@io.vertx.lang.rx.RxGen(io.vertx.ext.web.Cookie.class) public class Cookie { @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; Cookie that = (Cookie) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final io.vertx.lang.rx.TypeArg<Cookie> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new Cookie((io.vertx.ext.web.Cookie) obj), Cookie::getDelegate ); private final io.vertx.ext.web.Cookie delegate; public Cookie(io.vertx.ext.web.Cookie delegate) { this.delegate = delegate; } public io.vertx.ext.web.Cookie getDelegate() { return delegate; }
Create a new cookie
Params:
  • name – the name of the cookie
  • value – the cookie value
Returns:the cookie
/** * Create a new cookie * @param name the name of the cookie * @param value the cookie value * @return the cookie */
public static io.vertx.reactivex.ext.web.Cookie cookie(String name, String value) { io.vertx.reactivex.ext.web.Cookie ret = io.vertx.reactivex.ext.web.Cookie.newInstance(io.vertx.ext.web.Cookie.cookie(name, value)); return ret; }
Returns:the name of this cookie
/** * @return the name of this cookie */
public String getName() { String ret = delegate.getName(); return ret; }
Returns:the value of this cookie
/** * @return the value of this cookie */
public String getValue() { String ret = delegate.getValue(); return ret; }
Sets the value of this cookie
Params:
  • value – The value to set
Returns:a reference to this, so the API can be used fluently
/** * Sets the value of this cookie * @param value The value to set * @return a reference to this, so the API can be used fluently */
public io.vertx.reactivex.ext.web.Cookie setValue(String value) { delegate.setValue(value); return this; }
Sets the domain of this cookie
Params:
  • domain – The domain to use
Returns:a reference to this, so the API can be used fluently
/** * Sets the domain of this cookie * @param domain The domain to use * @return a reference to this, so the API can be used fluently */
public io.vertx.reactivex.ext.web.Cookie setDomain(String domain) { delegate.setDomain(domain); return this; }
Returns:the domain for the cookie
/** * @return the domain for the cookie */
public String getDomain() { String ret = delegate.getDomain(); return ret; }
Sets the path of this cookie.
Params:
  • path – The path to use for this cookie
Returns:a reference to this, so the API can be used fluently
/** * Sets the path of this cookie. * @param path The path to use for this cookie * @return a reference to this, so the API can be used fluently */
public io.vertx.reactivex.ext.web.Cookie setPath(String path) { delegate.setPath(path); return this; }
Returns:the path for this cookie
/** * @return the path for this cookie */
public String getPath() { String ret = delegate.getPath(); return ret; }
Sets the maximum age of this cookie in seconds. If an age of 0 is specified, this cookie will be automatically removed by browser because it will expire immediately. If Long is specified, this cookie will be removed when the browser is closed. If you don't set this the cookie will be a session cookie and be removed when the browser is closed.
Params:
  • maxAge – The maximum age of this cookie in seconds
Returns:
/** * Sets the maximum age of this cookie in seconds. * If an age of <code>0</code> is specified, this cookie will be * automatically removed by browser because it will expire immediately. * If {@link java.lang.Long} is specified, this cookie will be removed when the * browser is closed. * If you don't set this the cookie will be a session cookie and be removed when the browser is closed. * @param maxAge The maximum age of this cookie in seconds * @return */
public io.vertx.reactivex.ext.web.Cookie setMaxAge(long maxAge) { delegate.setMaxAge(maxAge); return this; }
Sets the security getStatus of this cookie
Params:
  • secure – True if this cookie is to be secure, otherwise false
Returns:a reference to this, so the API can be used fluently
/** * Sets the security getStatus of this cookie * @param secure True if this cookie is to be secure, otherwise false * @return a reference to this, so the API can be used fluently */
public io.vertx.reactivex.ext.web.Cookie setSecure(boolean secure) { delegate.setSecure(secure); return this; }
Determines if this cookie is HTTP only. If set to true, this cookie cannot be accessed by a client side script. However, this works only if the browser supports it. For for information, please look here.
Params:
  • httpOnly – True if the cookie is HTTP only, otherwise false.
Returns:
/** * Determines if this cookie is HTTP only. * If set to true, this cookie cannot be accessed by a client * side script. However, this works only if the browser supports it. * For for information, please look * <a href="http://www.owasp.org/index.php/HTTPOnly">here</a>. * @param httpOnly True if the cookie is HTTP only, otherwise false. * @return */
public io.vertx.reactivex.ext.web.Cookie setHttpOnly(boolean httpOnly) { delegate.setHttpOnly(httpOnly); return this; }
Encode the cookie to a string. This is what is used in the Set-Cookie header
Returns:the encoded cookie
/** * Encode the cookie to a string. This is what is used in the Set-Cookie header * @return the encoded cookie */
public String encode() { String ret = delegate.encode(); return ret; }
Has the cookie been changed? Changed cookies will be saved out in the response and sent to the browser.
Returns:true if changed
/** * Has the cookie been changed? Changed cookies will be saved out in the response and sent to the browser. * @return true if changed */
public boolean isChanged() { boolean ret = delegate.isChanged(); return ret; }
Set the cookie as being changed. Changed will be true for a cookie just created, false by default if just read from the request
Params:
  • changed – true if changed
/** * Set the cookie as being changed. Changed will be true for a cookie just created, false by default if just * read from the request * @param changed true if changed */
public void setChanged(boolean changed) { delegate.setChanged(changed); }
Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request.
Returns:true if the cookie comes from the User Agent.
/** * Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request. * @return true if the cookie comes from the User Agent. */
public boolean isFromUserAgent() { boolean ret = delegate.isFromUserAgent(); return ret; } public static Cookie newInstance(io.vertx.ext.web.Cookie arg) { return arg != null ? new Cookie(arg) : null; } }