org.weborganic.bastille.cache.util
Enum HttpHeader.Type

java.lang.Object
  extended by java.lang.Enum<HttpHeader.Type>
      extended by org.weborganic.bastille.cache.util.HttpHeader.Type
All Implemented Interfaces:
Serializable, Comparable<HttpHeader.Type>
Enclosing class:
HttpHeader<T extends Serializable>

public static enum HttpHeader.Type
extends Enum<HttpHeader.Type>

Used to help differentiate the different header types.


Enum Constant Summary
DATE
          A date Header.
INT
          A int Header.
STRING
          A String Header.
 
Method Summary
static HttpHeader.Type determineType(Class<? extends Serializable> clazz)
          Determines the HttpHeader.Type of the Header.
 Class<? extends Serializable> getTypeClass()
           
static HttpHeader.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static HttpHeader.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STRING

public static final HttpHeader.Type STRING
A String Header. HttpServletResponse.setHeader(String, String)


DATE

public static final HttpHeader.Type DATE
A date Header. HttpServletResponse.setDateHeader(String, long)


INT

public static final HttpHeader.Type INT
A int Header. HttpServletResponse.setIntHeader(String, int)

Method Detail

values

public static HttpHeader.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HttpHeader.Type c : HttpHeader.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HttpHeader.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getTypeClass

public Class<? extends Serializable> getTypeClass()
Returns:
The header type class this Type represents

determineType

public static HttpHeader.Type determineType(Class<? extends Serializable> clazz)
Determines the HttpHeader.Type of the Header.

Parameters:
clazz - The class to test.
Returns:
The corresponding type (never null).
Throws:
IllegalArgumentException - if the specified class does not match any of the Types