Package org.jdrupes.httpcodec.types
Class CacheControlDirectives
java.lang.Object
org.jdrupes.httpcodec.types.CacheControlDirectives
Represents a list of Cache-Control directives.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a new empty cookie list.CacheControlDirectives
(Collection<Directive> existing) Creates a new list with items copied from the existing collection. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CacheControlDirectives
public CacheControlDirectives()Creates a new empty cookie list. -
CacheControlDirectives
Creates a new list with items copied from the existing collection.- Parameters:
existing
- the existing collection
-
-
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
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 existingno-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
-
iterator
-
stream
-
remove
Remove the directive with the given name.- Parameters:
name
-- Returns:
- the directives for easy chaining
-
size
-