aerogear-controller 1.0.2

org.jboss.aerogear.controller.router.parameter
Class RequestParameter<T>

java.lang.Object
  extended by org.jboss.aerogear.controller.router.parameter.Parameter<T>
      extended by org.jboss.aerogear.controller.router.parameter.RequestParameter<T>

public class RequestParameter<T>
extends Parameter<T>

A RequestParameter is a parameter that comes from the request, for example a query, form, cookie, header, or path parameter.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.aerogear.controller.router.parameter.Parameter
Parameter.Type
 
Field Summary
private  com.google.common.base.Optional<T> defaultValue
           
private  String name
           
 
Constructor Summary
RequestParameter(String name, Parameter.Type parameterType, Class<T> type)
          Constructs a RequestParameter with a name, Paramter.Type, and specifies the type of the value in the parameter.
RequestParameter(String name, Parameter.Type parameterType, T defaultValue, Class<T> type)
          Constructs a RequestParameter with a name, Parameter.Type, and specifies the type of the value in the parameter and allows for a default value to be specified which will be used if the parameter is missing from the request.
 
Method Summary
 com.google.common.base.Optional<T> getDefaultValue()
           
 String getName()
           
 String toString()
           
 
Methods inherited from class org.jboss.aerogear.controller.router.parameter.Parameter
constant, equals, getParameterType, getType, hashCode, param, param, param, replacementParam
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final String name

defaultValue

private final com.google.common.base.Optional<T> defaultValue
Constructor Detail

RequestParameter

public RequestParameter(String name,
                        Parameter.Type parameterType,
                        Class<T> type)
Constructs a RequestParameter with a name, Paramter.Type, and specifies the type of the value in the parameter.

Parameters:
name - the name of this parameter, the name of the query, form, cookie, header, or path parameter.
parameterType - the Parameter.Type of this parameter.
type - the class type of this parameter.

RequestParameter

public RequestParameter(String name,
                        Parameter.Type parameterType,
                        T defaultValue,
                        Class<T> type)
Constructs a RequestParameter with a name, Parameter.Type, and specifies the type of the value in the parameter and allows for a default value to be specified which will be used if the parameter is missing from the request.

Parameters:
name - the name of this parameter, the name of the query, form, cookie, header, or path parameter.
parameterType - the Parameter.Type of this parameter.
defaultValue - the value to be used if this parameter, identified by name, is missing from the request.
type - the class type of this parameter.
Method Detail

getName

public String getName()

getDefaultValue

public com.google.common.base.Optional<T> getDefaultValue()

toString

public String toString()
Overrides:
toString in class Parameter<T>

aerogear-controller 1.0.2

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.