com.ramblingwood.minecraft.jsonapi.api
Class APIMethodName

java.lang.Object
  extended by com.ramblingwood.minecraft.jsonapi.api.APIMethodName

public class APIMethodName
extends java.lang.Object

This class represents an API method such as "remotetoolkit.startServer" or "getServer". The part before the dot is called the namespace and the part after is called the method name.

Author:
alecgorge

Constructor Summary
APIMethodName(java.lang.String combined)
           
APIMethodName(java.lang.String namespace, java.lang.String method)
           
 
Method Summary
 java.lang.String getMethodName()
          For the API method "foo.bar", this method will return "bar".
 java.lang.String getNamespace()
          For the API method "foo.bar", this method will return "foo".
 boolean matches(java.lang.String test)
          For the API method "foo.bar", this method will return true if test is "foo.bar" and false otherwise.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

APIMethodName

public APIMethodName(java.lang.String namespace,
                     java.lang.String method)

APIMethodName

public APIMethodName(java.lang.String combined)
Method Detail

getNamespace

public java.lang.String getNamespace()
For the API method "foo.bar", this method will return "foo". For the API method "bar", this method will return "";

Returns:
The namespace

getMethodName

public java.lang.String getMethodName()
For the API method "foo.bar", this method will return "bar". For the API method "bar", this method will return "bar";

Returns:
The method name

matches

public boolean matches(java.lang.String test)
For the API method "foo.bar", this method will return true if test is "foo.bar" and false otherwise. For the API method "bar", this method will return true if test is "bar" and false otherwise.

Parameters:
test - The fully-qualified string to test against.
Returns:
If test matches the API method represented.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object