3 import java.util.ArrayList;
4 import org.opensrf.util.*;
7 public class Method extends OSRFObject {
9 /** The method API name */
11 /** The ordered list of method params */
12 private List<Object> params;
14 /** Create a registry for the osrfMethod object */
15 private static OSRFRegistry registry =
16 OSRFRegistry.registerObject(
18 OSRFRegistry.WireProtocol.HASH,
19 new String[] {"method", "params"});
22 * @param name The method API name
24 public Method(String name) {
26 this.params = new ArrayList<Object>(8);
30 * @param name The method API name
31 * @param params The ordered list of params
33 public Method(String name, List<Object> params) {
39 * @return The method API name
41 public String getName() {
45 * @return The ordered list of params
47 public List<Object> getParams() {
52 * Pushes a new param object onto the set of params
53 * @param p The new param to add to the method.
55 public void addParam(Object p) {
60 * Implements the generic get() API required by OSRFSerializable
62 public Object get(String field) {
63 if("method".equals(field))
65 if("params".equals(field))
71 * @return The osrfMethod registry.
73 public OSRFRegistry getRegistry() {