public final class UtilityClassTestUtil extends Object
Modifier and Type | Field and Description |
---|---|
private static ResourceBundle |
R
Resource bundle.
|
Modifier | Constructor and Description |
---|---|
private |
UtilityClassTestUtil()
Prevent instantiation of utility class.
|
Modifier and Type | Method and Description |
---|---|
private static void |
assertUtilityClassClassWellDefined(Class<?> clazz)
A utility class class is well defined if it is final and there is one and
only one declared constructor.
|
private static void |
assertUtilityClassConstructorWellDefined(Constructor<?> constructor)
A utility class constructor is well defined if it is private.
|
private static void |
assertUtilityClassMethodsWellDefined(Class<?> clazz)
Methods of a utility class should be static if it was defined on the
class itself.
|
static void |
assertUtilityClassWellDefined(Class<?> clazz)
Verifies that a utility class is well defined.
|
private static final ResourceBundle R
private UtilityClassTestUtil()
private static void assertUtilityClassClassWellDefined(Class<?> clazz)
clazz
- class to evaluateprivate static void assertUtilityClassConstructorWellDefined(Constructor<?> constructor) throws ReflectiveOperationException
constructor
- constructorReflectiveOperationException
- when there is a problem performing reflection on the class.private static void assertUtilityClassMethodsWellDefined(Class<?> clazz)
clazz
- class to evaluatepublic static void assertUtilityClassWellDefined(Class<?> clazz) throws ReflectiveOperationException
clazz
- utility class to verify.ReflectiveOperationException
- problem accessing the class or its elements using reflection.Copyright © 2012–2015 Trajano. All rights reserved.