aerogear-controller 1.0.2

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

java.lang.Object
  extended by org.jboss.aerogear.controller.router.parameter.Parameter<T>
Direct Known Subclasses:
ConstantParameter, ReplacementParameter, RequestParameter

public class Parameter<T>
extends Object

Parameter represents a single target endpoint method parameter.


Nested Class Summary
static class Parameter.Type
           
 
Field Summary
private  Parameter.Type parameterType
           
private  Class<T> type
           
 
Constructor Summary
Parameter(Parameter.Type parameterType, Class<T> type)
          Sole constructor.
 
Method Summary
static
<T> Parameter<T>
constant(T value, Class<T> type)
           
 boolean equals(Object obj)
           
 Parameter.Type getParameterType()
          Gets the Parameter.Type of this parameter.
 Class<?> getType()
          Gets the type of this parameter.
 int hashCode()
           
static
<T> Parameter<T>
param(Class<T> type)
           
static
<T> Parameter<T>
param(String name, Class<T> type)
           
static
<T> Parameter<T>
param(String name, T defaultValue, Class<T> type)
           
static
<T> Parameter<T>
replacementParam(String str, Set<String> paramNames, Class<T> type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parameterType

private final Parameter.Type parameterType

type

private final Class<T> type
Constructor Detail

Parameter

public Parameter(Parameter.Type parameterType,
                 Class<T> type)
Sole constructor.

Parameters:
parameterType - the Parameter.Type of request parameter.
type - the expected type of the value of the request parameter.
Method Detail

param

public static <T> Parameter<T> param(Class<T> type)

param

public static <T> Parameter<T> param(String name,
                                     Class<T> type)

param

public static <T> Parameter<T> param(String name,
                                     T defaultValue,
                                     Class<T> type)

constant

public static <T> Parameter<T> constant(T value,
                                        Class<T> type)

replacementParam

public static <T> Parameter<T> replacementParam(String str,
                                                Set<String> paramNames,
                                                Class<T> type)

getParameterType

public Parameter.Type getParameterType()
Gets the Parameter.Type of this parameter. The parameter migth come from a request query param, a form param, a header param, a cookie param, or could be in the body of the request.

Returns:
Type the Parameter.Type of this parameter.

getType

public Class<?> getType()
Gets the type of this parameter. This is the type of the value of the Parameter.Type, for example the Type might be a query param (REQUEST) and the value of that query param might be of type String.class.

Returns:
Class the class type of this parameter.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

aerogear-controller 1.0.2

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