public final class FacebookMethodsTypeHelper extends Object
FacebookMethodsType.| Modifier and Type | Class and Description |
|---|---|
static class |
FacebookMethodsTypeHelper.MatchType |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Class<?>> |
allArguments()
Get argument types and names used by all methods.
|
static String |
convertToGetMethod(String name) |
static String |
convertToSearchMethod(String name) |
static List<FacebookMethodsType> |
filterMethods(List<FacebookMethodsType> methods,
FacebookMethodsTypeHelper.MatchType matchType,
String... argNames)
Filters a list of methods to those that take the given set of arguments.
|
static List<Object> |
getArguments(String name)
Gets argument types and names for all overloaded methods with the given name.
|
static List<Object> |
getArgumentsForNameStyle(String name,
FacebookNameStyle style)
Gets argument types and names for all overloaded methods with the given short form name.
|
static List<FacebookMethodsType> |
getCandidateMethods(String name,
String... argNames)
Gets methods that match the given name and arguments.
Note that the args list is a required subset of arguments for returned methods.
|
static FacebookMethodsType |
getHighestPriorityMethod(List<FacebookMethodsType> filteredMethods) |
static Set<String> |
getMissingProperties(String methodName,
FacebookNameStyle nameStyle,
Set<String> argNames)
Get missing properties.
|
static Class<?> |
getType(String argName)
Get the type for the given argument name.
|
static Object |
invokeMethod(facebook4j.Facebook facebook,
FacebookMethodsType method,
Map<String,Object> properties)
Invokes given method with argument values from given properties.
|
public static List<FacebookMethodsType> getCandidateMethods(String name, String... argNames)
name - case sensitive full method name to lookupargNames - unordered required argument namespublic static List<FacebookMethodsType> filterMethods(List<FacebookMethodsType> methods, FacebookMethodsTypeHelper.MatchType matchType, String... argNames)
methods - list of methods to filtermatchType - whether the arguments are an exact match, a subset or a super set of method argsargNames - argument names to filter the listpublic static List<Object> getArguments(String name) throws IllegalArgumentException
name - method name, must be a long form (i.e. get*, or search*)IllegalArgumentExceptionpublic static List<Object> getArgumentsForNameStyle(String name, FacebookNameStyle style) throws IllegalArgumentException
name - method name, may be a short formstyle - name styleIllegalArgumentExceptionpublic static Set<String> getMissingProperties(String methodName, FacebookNameStyle nameStyle, Set<String> argNames)
methodName - method namenameStyle - method name styleargNames - available argumentspublic static Map<String,Class<?>> allArguments()
public static Class<?> getType(String argName) throws IllegalArgumentException
argName - argument nameIllegalArgumentExceptionpublic static String convertToGetMethod(String name) throws IllegalArgumentException
IllegalArgumentExceptionpublic static String convertToSearchMethod(String name) throws IllegalArgumentException
IllegalArgumentExceptionpublic static FacebookMethodsType getHighestPriorityMethod(List<FacebookMethodsType> filteredMethods)
public static Object invokeMethod(facebook4j.Facebook facebook, FacebookMethodsType method, Map<String,Object> properties) throws org.apache.camel.RuntimeCamelException
facebook - Facebook4J target object for invokemethod - method to invokeproperties - Map of argumentsorg.apache.camel.RuntimeCamelException - on errorsApache Camel