org.mockcentral.server
Enum MockMethodType

java.lang.Object
  extended by java.lang.Enum<MockMethodType>
      extended by org.mockcentral.server.MockMethodType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MockMethodType>

public enum MockMethodType
extends java.lang.Enum<MockMethodType>

An enum declaring the available Mock Object method types ("expect and return", "match and throw", etc) to use in the construction of MethodExpectationBean instances.

Author:
David Hutchinson
See Also:
MethodExpectationBean

Enum Constant Summary
EXPECT_AND_RETURN
          The method will expect an invocation and optionally return a value.
EXPECT_AND_THROW
          The method will expect an invocation and throw a Throwable.
MATCH_AND_RETURN
          The method will accept any invocation and optionally return a value.
MATCH_AND_THROW
          The method will accept any invocation and throw a Throwable.
 
Method Summary
 java.lang.String getLabel()
          Returns the label for this Enum value.
static MockMethodType getMethodType(java.lang.String label)
          Returns the MockMethodType corresponding to the supplied label.
static MockMethodType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static MockMethodType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EXPECT_AND_RETURN

public static final MockMethodType EXPECT_AND_RETURN
The method will expect an invocation and optionally return a value.


EXPECT_AND_THROW

public static final MockMethodType EXPECT_AND_THROW
The method will expect an invocation and throw a Throwable.


MATCH_AND_RETURN

public static final MockMethodType MATCH_AND_RETURN
The method will accept any invocation and optionally return a value.


MATCH_AND_THROW

public static final MockMethodType MATCH_AND_THROW
The method will accept any invocation and throw a Throwable.

Method Detail

values

public static MockMethodType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MockMethodType c : MockMethodType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MockMethodType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getLabel

public java.lang.String getLabel()
Returns the label for this Enum value.

Returns:
the label for this Enum value.

getMethodType

public static MockMethodType getMethodType(java.lang.String label)
                                    throws MockCentralServerException
Returns the MockMethodType corresponding to the supplied label.

Parameters:
label - the label for the MockMethodType
Returns:
the MockMethodType corresponding to the supplied label.
Throws:
MockCentralServerException - if there is no MockMethodType with the supplied label.