Package io.minio

Class Http.Headers

java.lang.Object
io.minio.Http.Headers
All Implemented Interfaces:
Iterable<Map.Entry<String,String>>
Enclosing class:
Http

public static class Http.Headers extends Object implements Iterable<Map.Entry<String,String>>
HTTP headers.
  • Field Details

  • Constructor Details

    • Headers

      public Headers()
      Creates empty headers.
    • Headers

      public Headers(Http.Headers source)
      Creates headers as copy of the specified source.
    • Headers

      public Headers(Map<String,String> source)
      Creates headers as copy of the specified source.
    • Headers

      public Headers(com.google.common.collect.Multimap<String,String> source)
      Creates headers as copy of the specified source.
    • Headers

      public Headers(String... keysAndValues)
      Creates headers by alternating names and values.
  • Method Details

    • merge

      public static Http.Headers merge(Http.Headers... headersList)
      Creates new headers by merging names and values from the specified headers list.
    • add

      public void add(@Nonnull String name, @Nonnull String value)
      Adds the specified value to the name in this headers. If the name already exists, the value is appended uniquely.
    • set

      public void set(@Nonnull String name, @Nonnull String value)
      Sets the specified name and value in this headers.
    • getFirst

      public String getFirst(String name)
      Gets the first value of the specified name in this headers.
    • contains

      public boolean contains(String name)
      Checks whether the specified name exists in this headers.
    • namePrefixAny

      public boolean namePrefixAny(String prefix)
      Checks whether any name in this headers starts with the specified prefix or not.
    • names

      public Set<String> names()
      Gets all names in this headers.
    • iterator

      public Iterator<Map.Entry<String,String>> iterator()
      Gets iterator of this headers.
      Specified by:
      iterator in interface Iterable<Map.Entry<String,String>>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toHttpHeaders

      public okhttp3.Headers toHttpHeaders()
      Gets new okhttp3.Headers by populating this headers.
    • clear

      public void clear()
      Clears all names and values in this headers.
    • containsKey

      public boolean containsKey(String name)
      Checks whether the specified name exists in this headers.
    • entrySet

      public Set<Map.Entry<String,String>> entrySet()
      Gets Set of Map.Entry of this headers.
    • entries

      public Set<Map.Entry<String,String>> entries()
      Gets Set of Map.Entry of this headers.
    • get

      public Set<String> get(String name)
      Gets set of values of the specified name in this headers.
    • keySet

      public Set<String> keySet()
      Gets set of values of the specified name in this headers.
    • put

      public boolean put(@Nonnull String name, @Nonnull String value)
      Adds the specified value to the name in this headers. If the name already exists, the value is appended uniquely.
    • put

      public boolean put(@Nonnull String name, @Nonnull Set<String> values)
      Adds set of values for the specified name to this headers.
    • put

      public boolean put(@Nonnull String name, @Nonnull List<String> values)
      Adds list of values for the specified name to this headers.
    • putAll

      public Http.Headers putAll(Map<String,String> source)
      Adds all names and values from the specified source to this headers.
    • putAll

      public Http.Headers putAll(com.google.common.collect.Multimap<String,String> source)
      Adds all names and values from the specified source to this headers.
    • putAll

      public Http.Headers putAll(Http.Headers source)
      Adds all names and values from the specified source to this headers.
    • remove

      public Set<String> remove(String name)
      Removes the specified name from this headers.
    • remove

      public boolean remove(String name, String value)
      Removes the specified value of the specified name from this headers.
    • removeAll

      public boolean removeAll(String name)
      Removes the specified name from this headers.
    • size

      public int size()
      Gets size of this headers.