Class DefaultSpdyHeaders

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>

    public class DefaultSpdyHeaders
    extends SpdyHeaders
    • Constructor Detail

      • DefaultSpdyHeaders

        DefaultSpdyHeaders()
    • Method Detail

      • hash

        private static int hash​(java.lang.String name)
      • eq

        private static boolean eq​(java.lang.String name1,
                                  java.lang.String name2)
      • index

        private static int index​(int hash)
      • add

        public SpdyHeaders add​(java.lang.String name,
                               java.lang.Object value)
        Description copied from class: SpdyHeaders
        Adds a new header with the specified name and value.
        Specified by:
        add in class SpdyHeaders
      • add0

        private void add0​(int h,
                          int i,
                          java.lang.String name,
                          java.lang.String value)
      • remove

        public SpdyHeaders remove​(java.lang.String name)
        Description copied from class: SpdyHeaders
        Removes the header with the specified name.
        Specified by:
        remove in class SpdyHeaders
      • remove0

        private void remove0​(int h,
                             int i,
                             java.lang.String name)
      • set

        public SpdyHeaders set​(java.lang.String name,
                               java.lang.Object value)
        Description copied from class: SpdyHeaders
        Sets a new header with the specified name and value. If there is an existing header with the same name, the existing header is removed.
        Specified by:
        set in class SpdyHeaders
      • set

        public SpdyHeaders set​(java.lang.String name,
                               java.lang.Iterable<?> values)
        Description copied from class: SpdyHeaders
        Sets a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed.
        Specified by:
        set in class SpdyHeaders
      • get

        public java.lang.String get​(java.lang.String name)
        Description copied from class: SpdyHeaders
        Returns the header value with the specified header name. If there is more than one header value for the specified header name, the first value is returned.
        Specified by:
        get in class SpdyHeaders
        Returns:
        the header value or null if there is no such header
      • getAll

        public java.util.List<java.lang.String> getAll​(java.lang.String name)
        Description copied from class: SpdyHeaders
        Returns the header values with the specified header name.
        Specified by:
        getAll in class SpdyHeaders
        Returns:
        the List of header values. An empty list if there is no such header.
      • entries

        public java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>> entries()
        Description copied from class: SpdyHeaders
        Returns all header names and values that this frame contains.
        Specified by:
        entries in class SpdyHeaders
        Returns:
        the List of the header name-value pairs. An empty list if there is no header in this message.
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.String>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>
        Overrides:
        iterator in class SpdyHeaders
      • contains

        public boolean contains​(java.lang.String name)
        Description copied from class: SpdyHeaders
        Returns true if and only if there is a header with the specified header name.
        Specified by:
        contains in class SpdyHeaders
      • names

        public java.util.Set<java.lang.String> names()
        Description copied from class: SpdyHeaders
        Returns the Set of all header names that this frame contains.
        Specified by:
        names in class SpdyHeaders
      • add

        public SpdyHeaders add​(java.lang.String name,
                               java.lang.Iterable<?> values)
        Description copied from class: SpdyHeaders
        Adds a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed.
        Specified by:
        add in class SpdyHeaders
      • isEmpty

        public boolean isEmpty()
        Description copied from class: SpdyHeaders
        Checks if no header exists.
        Specified by:
        isEmpty in class SpdyHeaders
      • toString

        private static java.lang.String toString​(java.lang.Object value)