javax.ws.rs.core

Class Cookie

  • Direct Known Subclasses:
    NewCookie

    public class Cookie
    extends Object
    Represents the value of a HTTP cookie, transferred in a request. RFC 2109 specifies the legal characters for name, value, path and domain. The default version of 1 corresponds to RFC 2109.
    Since:
    1.0
    Author:
    Paul Sandoz, Marc Hadley
    See Also:
    IETF RFC 2109
    • Field Detail

      • DEFAULT_VERSION

        public static final int DEFAULT_VERSION
        Cookies using the default version correspond to RFC 2109.
        See Also:
        Constant Field Values
    • Constructor Detail

      • public Cookie(String name,
                      String value,
                      String path,
                      String domain,
                      int version)
               throws IllegalArgumentException
        Create a new instance.
        Parameters:
        name - the name of the cookie.
        value - the value of the cookie.
        path - the URI path for which the cookie is valid.
        domain - the host domain for which the cookie is valid.
        version - the version of the specification to which the cookie complies.
        Throws:
        IllegalArgumentException - if name is null.
      • public Cookie(String name,
                      String value,
                      String path,
                      String domain)
               throws IllegalArgumentException
        Create a new instance.
        Parameters:
        name - the name of the cookie.
        value - the value of the cookie.
        path - the URI path for which the cookie is valid.
        domain - the host domain for which the cookie is valid.
        Throws:
        IllegalArgumentException - if name is null.
    • Method Detail

      • valueOf

        public static Cookie valueOf(String value)
        Creates a new instance of Cookie by parsing the supplied string.
        Parameters:
        value - the cookie string.
        Returns:
        the newly created Cookie.
        Throws:
        IllegalArgumentException - if the supplied string cannot be parsed or is null.
      • getName

        public String getName()
        Get the name of the cookie.
        Returns:
        the cookie name.
      • getValue

        public String getValue()
        Get the value of the cookie.
        Returns:
        the cookie value.
      • getVersion

        public int getVersion()
        Get the version of the cookie.
        Returns:
        the cookie version.
      • getDomain

        public String getDomain()
        Get the domain of the cookie.
        Returns:
        the cookie domain.
      • getPath

        public String getPath()
        Get the path of the cookie.
        Returns:
        the cookie path.
      • toString

        public String toString()
        Convert the cookie to a string suitable for use as the value of the corresponding HTTP header.
        Overrides:
        toString in class Object
        Returns:
        a stringified cookie.
      • hashCode

        public int hashCode()
        Generate a hash code by hashing all of the cookies properties.
        Overrides:
        hashCode in class Object
        Returns:
        the cookie hash code.
      • equals

        public boolean equals(Object obj)
        Compare for equality.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare to.
        Returns:
        true, if the object is a Cookie with the same value for all properties, false otherwise.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/core/Cookie.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com, Cookie (Java(TM) EE 7 Specification APIs)

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.