water.api
Enum RequestStatics.RequestType

java.lang.Object
  extended by java.lang.Enum<RequestStatics.RequestType>
      extended by water.api.RequestStatics.RequestType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<RequestStatics.RequestType>
Enclosing class:
RequestStatics

public static enum RequestStatics.RequestType
extends java.lang.Enum<RequestStatics.RequestType>

Request type. Requests can have multiple types. Basic types include the plain json type in which the result is returned as a JSON object, a html type that acts as the webpage, or the help type that displays the extended help for the request. The wiki type is also added that displays the markup of the wiki that should be used to document the request as per Matt's suggestion. NOTE the requests are distinguished by their suffixes. Please make the suffix start with the dot character to avoid any problems with request names.


Enum Constant Summary
help
           
json
           
png
           
query
           
txt
           
www
           
 
Field Summary
 java.lang.String _suffix
          Suffix of the request - extension of the URL.
 
Method Summary
 java.lang.String requestName(java.lang.String requestUrl)
          Returns the name of the request, that is the request url without the request suffix.
static RequestStatics.RequestType requestType(java.lang.String requestUrl)
          Returns the request type of a given URL.
static RequestStatics.RequestType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static RequestStatics.RequestType[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

json

public static final RequestStatics.RequestType json

www

public static final RequestStatics.RequestType www

help

public static final RequestStatics.RequestType help

query

public static final RequestStatics.RequestType query

png

public static final RequestStatics.RequestType png

txt

public static final RequestStatics.RequestType txt
Field Detail

_suffix

public final java.lang.String _suffix
Suffix of the request - extension of the URL.

Method Detail

values

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

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

valueOf

public static RequestStatics.RequestType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

requestType

public static RequestStatics.RequestType requestType(java.lang.String requestUrl)
Returns the request type of a given URL. JSON request type is the default type when the extension from the URL cannot be determined.


requestName

public java.lang.String requestName(java.lang.String requestUrl)
Returns the name of the request, that is the request url without the request suffix.