org.jboss.aerogear.controller.router.parameter
Class Parameter<T>
java.lang.Object
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.
parameterType
private final Parameter.Type parameterType
type
private final Class<T> type
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.
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
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.