public class ImmutableClassChecker extends Object
Constructor and Description |
---|
ImmutableClassChecker() |
Modifier and Type | Method and Description |
---|---|
static void |
assertThatClassIsImmutable(Class<?> clazz)
Assert that the given class adheres to the immutable class rules.
|
static void |
assertThatClassIsImmutableBaseClass(Class<?> clazz)
Assert that the given class adheres to the immutable class rules, but
is not declared final.
|
void |
describeMismatch(org.hamcrest.Description description)
Describe why an error was reported.
|
void |
describeTo(org.hamcrest.Description description)
Describe the source object that caused an error, using a Hamcrest
Matcher style interface.
|
public void describeMismatch(org.hamcrest.Description description)
description
- the Description object to use for reporting the
mismatchpublic void describeTo(org.hamcrest.Description description)
description
- the Description object to use to report the "to"
objectpublic static void assertThatClassIsImmutable(Class<?> clazz)
clazz
- the class to checkAssertionError
- if the class is not an
immutable classpublic static void assertThatClassIsImmutableBaseClass(Class<?> clazz)
clazz
- the class to checkAssertionError
- if the class is not an
immutable class