MCPcopy Index your code
hub / github.com/assertj/assertj / CharArrays

Class CharArrays

src/main/java/org/assertj/core/internal/CharArrays.java:30–331  ·  view source on GitHub ↗

Reusable assertions for arrays of chars. @author Alex Ruiz @author Joel Costigliola @author Mikhail Mazursky @author Nicolas François

Source from the content-addressed store, hash-verified

28 * @author Nicolas François
29 */
30public class CharArrays {
31
32 private static final CharArrays INSTANCE = new CharArrays();
33
34 /**
35 * Returns the singleton instance of this class.
36 *
37 * @return the singleton instance of this class.
38 */
39 public static CharArrays instance() {
40 return INSTANCE;
41 }
42
43 private Arrays arrays = Arrays.instance();
44
45 @VisibleForTesting
46 Failures failures = Failures.instance();
47
48 @VisibleForTesting
49 CharArrays() {
50 this(StandardComparisonStrategy.instance());
51 }
52
53 @VisibleForTesting
54 public Comparator<?> getComparator() {
55 return arrays.getComparator();
56 }
57
58 public CharArrays(ComparisonStrategy comparisonStrategy) {
59 this.arrays = new Arrays(comparisonStrategy);
60 }
61
62 /**
63 * Asserts that the given array is {@code null} or empty.
64 *
65 * @param info contains information about the assertion.
66 * @param actual the given array.
67 * @throws AssertionError if the given array is not {@code null} *and* contains one or more elements.
68 */
69 public void assertNullOrEmpty(AssertionInfo info, char[] actual) {
70 arrays.assertNullOrEmpty(info, failures, actual);
71 }
72
73 /**
74 * Asserts that the given array is empty.
75 *
76 * @param info contains information about the assertion.
77 * @param actual the given array.
78 * @throws AssertionError if the given array is {@code null}.
79 * @throws AssertionError if the given array is not empty.
80 */
81 public void assertEmpty(AssertionInfo info, char[] actual) {
82 arrays.assertEmpty(info, failures, actual);
83 }
84
85 /**
86 * Asserts that the given array is not empty.
87 *

Callers

nothing calls this directly

Calls 2

instanceMethod · 0.95
instanceMethod · 0.95

Tested by

no test coverage detected