org.apache.hadoop.hbase.rest
Enum Dispatcher.ContentType

java.lang.Object
  extended by java.lang.Enum<Dispatcher.ContentType>
      extended by org.apache.hadoop.hbase.rest.Dispatcher.ContentType
All Implemented Interfaces:
Serializable, Comparable<Dispatcher.ContentType>
Enclosing class:
Dispatcher

public static enum Dispatcher.ContentType
extends Enum<Dispatcher.ContentType>


Enum Constant Summary
JSON
           
MIME
           
NOT_ACCEPTABLE
           
PLAIN
           
XML
           
 
Method Summary
static Dispatcher.ContentType getContentType(String t)
          Utility method used looking at Accept header content.
 String toString()
           
static Dispatcher.ContentType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Dispatcher.ContentType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

XML

public static final Dispatcher.ContentType XML

JSON

public static final Dispatcher.ContentType JSON

PLAIN

public static final Dispatcher.ContentType PLAIN

MIME

public static final Dispatcher.ContentType MIME

NOT_ACCEPTABLE

public static final Dispatcher.ContentType NOT_ACCEPTABLE
Method Detail

values

public static Dispatcher.ContentType[] 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 (Dispatcher.ContentType c : Dispatcher.ContentType.values())
    System.out.println(c);

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

valueOf

public static Dispatcher.ContentType 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

toString

public String toString()
Overrides:
toString in class Enum<Dispatcher.ContentType>

getContentType

public static Dispatcher.ContentType getContentType(String t)
Utility method used looking at Accept header content.

Parameters:
t - The content type to examine.
Returns:
The enum that matches the prefix of t or the default enum if t is empty. If unsupported type, we return NOT_ACCEPTABLE.


Copyright © 2010 The Apache Software Foundation