Class Cookie.AbstractCookieBuilder<T extends Cookie.AbstractCookieBuilder<T>>

  • Type Parameters:
    T - the current AbstractCookieBuilder type.
    Direct Known Subclasses:
    Cookie.Builder, NewCookie.AbstractNewCookieBuilder
    Enclosing class:
    Cookie

    public abstract static class Cookie.AbstractCookieBuilder<T extends Cookie.AbstractCookieBuilder<T>>
    extends java.lang.Object
    JAX-RS abstract Cookie builder class.
    Since:
    3.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String domain  
      private java.lang.String name  
      private java.lang.String path  
      private java.lang.String value  
      private int version  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractCookieBuilder​(java.lang.String name)
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract Cookie build()
      Build a new Cookie instance using all the configuration previously specified in this builder.
      T domain​(java.lang.String domain)
      Set the domain of the cookie.
      T path​(java.lang.String path)
      Set the path of the cookie.
      private T self()  
      T value​(java.lang.String value)
      Set the value of the cookie.
      T version​(int version)
      Set the version of the cookie.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        private final java.lang.String name
      • value

        private java.lang.String value
      • version

        private int version
      • path

        private java.lang.String path
      • domain

        private java.lang.String domain
    • Constructor Detail

      • AbstractCookieBuilder

        public AbstractCookieBuilder​(java.lang.String name)
        Create a new instance.
        Parameters:
        name - the name of the cookie.
    • Method Detail

      • value

        public T value​(java.lang.String value)
        Set the value of the cookie.
        Parameters:
        value - the value of the cookie.
        Returns:
        the updated builder instance.
      • version

        public T version​(int version)
        Set the version of the cookie. Defaults to Cookie.DEFAULT_VERSION
        Parameters:
        version - the version of the specification to which the cookie complies.
        Returns:
        the updated builder instance.
      • path

        public T path​(java.lang.String path)
        Set the path of the cookie.
        Parameters:
        path - the URI path for which the cookie is valid.
        Returns:
        the updated builder instance.
      • domain

        public T domain​(java.lang.String domain)
        Set the domain of the cookie.
        Parameters:
        domain - the host domain for which the cookie is valid.
        Returns:
        the updated builder instance.
      • self

        private T self()
      • build

        public abstract Cookie build()
        Build a new Cookie instance using all the configuration previously specified in this builder.
        Returns:
        a new Cookie instance.
        Throws:
        java.lang.IllegalArgumentException - if name is null.