Package com.google.common.testing
Enum NullPointerTester.ExceptionTypePolicy
- java.lang.Object
-
- java.lang.Enum<NullPointerTester.ExceptionTypePolicy>
-
- com.google.common.testing.NullPointerTester.ExceptionTypePolicy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NullPointerTester.ExceptionTypePolicy>
- Enclosing class:
- NullPointerTester
private static enum NullPointerTester.ExceptionTypePolicy extends java.lang.Enum<NullPointerTester.ExceptionTypePolicy>
Strategy for exception type matching used byNullPointerTester
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NPE_IAE_OR_UOE
Exceptions should beNullPointerException
,IllegalArgumentException
, orUnsupportedOperationException
.NPE_OR_UOE
Exceptions should beNullPointerException
orUnsupportedOperationException
.
-
Constructor Summary
Constructors Modifier Constructor Description private
ExceptionTypePolicy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
isExpectedType(java.lang.Throwable cause)
static NullPointerTester.ExceptionTypePolicy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static NullPointerTester.ExceptionTypePolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NPE_OR_UOE
public static final NullPointerTester.ExceptionTypePolicy NPE_OR_UOE
Exceptions should beNullPointerException
orUnsupportedOperationException
.
-
NPE_IAE_OR_UOE
public static final NullPointerTester.ExceptionTypePolicy NPE_IAE_OR_UOE
Exceptions should beNullPointerException
,IllegalArgumentException
, orUnsupportedOperationException
.
-
-
Method Detail
-
values
public static NullPointerTester.ExceptionTypePolicy[] 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 (NullPointerTester.ExceptionTypePolicy c : NullPointerTester.ExceptionTypePolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NullPointerTester.ExceptionTypePolicy 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 namejava.lang.NullPointerException
- if the argument is null
-
isExpectedType
public abstract boolean isExpectedType(java.lang.Throwable cause)
-
-