Class CacheControlDirectives

java.lang.Object
org.jdrupes.httpcodec.types.CacheControlDirectives
All Implemented Interfaces:
Iterable<Directive>

public class CacheControlDirectives extends Object implements Iterable<Directive>
Represents a list of Cache-Control directives.
See Also:
  • Constructor Details

  • Method Details

    • valueForName

      Returns the value for the directive with the given name.
      Parameters:
      name - the name
      Returns:
      the value if a directive with the given name exists
    • add

      public CacheControlDirectives add(Directive directive)
      Adds a directive to the list.

      If a directive with the same name already exists, it is replaced (except for no-cache).

      The no-cache directive is handled specially. If no such directive exists, it is added. Else, if the new directive has no arguments, it replaces the existing no-cache directive. If both the existing directive and the new directive specify fields, the fields are merged.

      Parameters:
      directive - the directive
      Returns:
      the directives for easy chaining
    • clear

      Removes all directives from the list.
      Returns:
      the directives for easy chaining
    • isEmpty

      public boolean isEmpty()
    • iterator

      Specified by:
      iterator in interface Iterable<Directive>
    • stream

      public Stream<Directive> stream()
    • remove

      public boolean remove(String name)
      Remove the directive with the given name.
      Parameters:
      name -
      Returns:
      the directives for easy chaining
    • size

      public int size()