Class Method
- java.lang.Object
-
- com.yahoo.jrt.Method
-
public class Method extends java.lang.Object
A Method encapsulates the reflective information about a single RPC method.
Method parameters and return values are declared with type strings. A type string denotes the concatenation of type identifiers where a string is used to represent a sequence of types. For example 'ii' is the type string for two 32-bit integers, while 'iss' is the type string for a single 32-bit integer followed by two strings. The complete list of type identifiers can be found in the
Value
class.The type strings associated with actual method parameters and return values may only contain valid type identifiers. However, when you specify the parameters accepted by- or returned from a RPC method via the Method constructor, '*' may be used as the last character in the type string. Ending a type string specification with '*' means that additional values are optional and may have any type. This feature can also be used with the
Request.checkReturnTypes
method when verifying return types.
-
-
Constructor Summary
Constructors Constructor Description Method(java.lang.String name, java.lang.String paramTypes, java.lang.String returnTypes, MethodHandler handler)
Create a new Method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Method
methodDesc(java.lang.String desc)
Describe this method.Method
paramDesc(int index, java.lang.String name, java.lang.String desc)
Describe a parameter of this method.Method
returnDesc(int index, java.lang.String name, java.lang.String desc)
Describe a return value of this method.java.lang.String
toString()
-
-
-
Constructor Detail
-
Method
public Method(java.lang.String name, java.lang.String paramTypes, java.lang.String returnTypes, MethodHandler handler)
Create a new Method. The parameters define the name of the method, the parameter types, the return value types and also the handler for the method. Please refer to theMethod
class description for an explanation of type strings.- Parameters:
name
- method nameparamTypes
- a type string defining the parameter typesreturnTypes
- a type string defining the return value typeshandler
- the handler for this RPC method- Throws:
MethodCreateException
- if the handler is null.
-
-
Method Detail
-
methodDesc
public Method methodDesc(java.lang.String desc)
Describe this method. This adds documentation that can be obtained through remote reflection.- Returns:
- this Method, to allow chaining
-
paramDesc
public Method paramDesc(int index, java.lang.String name, java.lang.String desc)
Describe a parameter of this method. This adds documentation that can be obtained through remote reflection.- Parameters:
index
- the parameter indexname
- the parameter namedesc
- the parameter description- Returns:
- this Method, to allow chaining
-
returnDesc
public Method returnDesc(int index, java.lang.String name, java.lang.String desc)
Describe a return value of this method. This adds documentation that can be obtained through remote reflection.- Parameters:
index
- the return value indexname
- the return value namedesc
- the return value description- Returns:
- this Method, to allow chaining
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-