alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Play Framework/Scala example source code file (Cookie.java)

This example Play Framework source code file (Cookie.java) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Play Framework (and Scala) source code examples by using tags.

All credit for the original source code belongs to Play Framework; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Play Framework tags/keywords

comparable, cookie, core, netty, play, play framework, set, string, utility, utils

The Cookie.java Play Framework example source code

/*
 * Copyright 2012 The Netty Project
 *
 * The Netty Project 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 play.core.netty.utils;

import java.util.Set;

/**
 * An HTTP <a href="http://en.wikipedia.org/wiki/HTTP_cookie">Cookie</a>.
 */
public interface Cookie extends Comparable<Cookie> {

    /**
     * Returns the name of this cookie.
     */
    String getName();

    /**
     * Returns the value of this cookie.
     */
    String getValue();

    /**
     * Sets the value of this cookie.
     */
    void setValue(String value);

    /**
     * Returns the domain of this cookie.
     */
    String getDomain();

    /**
     * Sets the domain of this cookie.
     */
    void setDomain(String domain);

    /**
     * Returns the path of this cookie.
     */
    String getPath();

    /**
     * Sets the path of this cookie.
     */
    void setPath(String path);

    /**
     * Returns the comment of this cookie.
     */
    String getComment();

    /**
     * Sets the comment of this cookie.
     */
    void setComment(String comment);

    /**
     * Returns the max age of this cookie in seconds.
     */
    int getMaxAge();

    /**
     * Sets the max age of this cookie in seconds.  If {@code 0} is specified,
     * this cookie will be removed by browser because it will be expired
     * immediately.  If {@link Integer#MIN_VALUE} is specified, this cookie will be removed
     * when a user terminates browser.
     */
    void setMaxAge(int maxAge);

    /**
     * Returns the version of this cookie.
     */
    int getVersion();

    /**
     * Sets the version of this cookie.
     */
    void setVersion(int version);

    /**
     * Returns the secure flag of this cookie.
     */
    boolean isSecure();

    /**
     * Sets the secure flag of this cookie.
     */
    void setSecure(boolean secure);

    /**
     * Returns if this cookie cannot be accessed through client side script.
     * This flag works only if the browser supports it.  For more information,
     * see <a href="http://www.owasp.org/index.php/HTTPOnly">here</a>.
     */
    boolean isHttpOnly();

    /**
     * Sets if this cookie cannot be accessed through client side script.
     * This flag works only if the browser supports it.  For more information,
     * see <a href="http://www.owasp.org/index.php/HTTPOnly">here</a>.
     */
    void setHttpOnly(boolean httpOnly);

    /**
     * Returns the comment URL of this cookie.
     */
    String getCommentUrl();

    /**
     * Sets the comment URL of this cookie.
     */
    void setCommentUrl(String commentUrl);

    /**
     * Returns the discard flag of this cookie.
     */
    boolean isDiscard();

    /**
     * Sets the discard flag of this cookie.
     */
    void setDiscard(boolean discard);

    /**
     * Returns the ports of this cookie.
     */
    Set<Integer> getPorts();

    /**
     * Sets the ports of this cookie.
     */
    void setPorts(int... ports);

    /**
     * Sets the ports of this cookie.
     */
    void setPorts(Iterable<Integer> ports);
}

Other Play Framework source code examples

Here is a short list of links related to this Play Framework Cookie.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.