com.thetransactioncompany.jsonrpc2.util
Class ParamsRetriever

java.lang.Object
  extended by com.thetransactioncompany.jsonrpc2.util.ParamsRetriever
Direct Known Subclasses:
NamedParamsRetriever, PositionalParamsRetriever

public abstract class ParamsRetriever
extends Object

The base abstract class for the JSON-RPC 2.0 parameter retrievers.

Version:
1.34.3 (2012-12-22)
Author:
Vladimir Dzhuvinov

Constructor Summary
ParamsRetriever()
           
 
Method Summary
protected static
<T extends Enum<T>>
T
getEnumStringMatch(String input, Class<T> enumClass, boolean ignoreCase)
          Matches a string against an enumeration of acceptable values.
protected static String getEnumStringMatch(String input, String[] enumStrings, boolean ignoreCase)
          Matches a string against an array of acceptable values.
abstract  int size()
          Returns the parameter count.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamsRetriever

public ParamsRetriever()
Method Detail

size

public abstract int size()
Returns the parameter count.

Returns:
The parameters count.

getEnumStringMatch

protected static String getEnumStringMatch(String input,
                                           String[] enumStrings,
                                           boolean ignoreCase)
Matches a string against an array of acceptable values.

Parameters:
input - The string to match.
enumStrings - The acceptable string values. Must not be null.
ignoreCase - true for a case insensitive match.
Returns:
The matching string value, null if no match was found.

getEnumStringMatch

protected static <T extends Enum<T>> T getEnumStringMatch(String input,
                                                          Class<T> enumClass,
                                                          boolean ignoreCase)
Matches a string against an enumeration of acceptable values.

Parameters:
input - The string to match.
enumClass - The enumeration class specifying the acceptable string values. Must not be null.
ignoreCase - true for a case insensitive match.
Returns:
The matching enumeration constant, null if no match was found.


Copyright © 2013 The Transaction Company. All Rights Reserved.