org.codehaus.httpcache4j.cache
Class Vary
java.lang.Object
org.codehaus.httpcache4j.cache.Vary
- All Implemented Interfaces:
- ToJSON
public final class Vary
- extends Object
- implements ToJSON
Represents a HTTP Variation.
We need to store a different version of the response if the request varies on
E.G Accept headers.
Implementors of storage engines needs to have knowledge of this class.
See Key for how it's used.
- Author:
- Erlend Hamnaberg
Vary
public Vary()
- Default constructor (no variations)
Vary
public Vary(Map<String,String> headers)
- Constructor
- Parameters:
headers - the vary headers as keys from the response, with request headers as values.
Vary
public Vary(Headers headers)
size
public int size()
isEmpty
public boolean isEmpty()
matches
public boolean matches(HTTPRequest request)
- Analyses the headers in the given request to figure out if this
variation matches.
- Parameters:
request - the request to analyse
- Returns:
true if the request matches the variance. false if not.
toString
public String toString()
- Overrides:
toString in class Object
getVaryHeaders
public Map<String,String> getVaryHeaders()
fromJSON
public static Vary fromJSON(String value)
toJSON
public String toJSON()
- Specified by:
toJSON in interface ToJSON
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2008-2011. All Rights Reserved.