We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b28446 commit c0fc248Copy full SHA for c0fc248
1 file changed
src/main/java/org/apache/xml/security/stax/ext/ComparableType.java
@@ -18,15 +18,19 @@
18
*/
19
package org.apache.xml.security.stax.ext;
20
21
+import java.util.Objects;
22
23
/**
24
+ * Two comparable types are compared by their name.
25
+ *
26
+ * @param <T> Compatible class type.
27
-public abstract class ComparableType<T extends ComparableType> implements Comparable<T> {
28
+public abstract class ComparableType<T extends ComparableType<T>> implements Comparable<T> {
29
- private String name;
30
+ private final String name;
31
32
public ComparableType(String name) {
- this.name = name;
33
+ this.name = Objects.requireNonNull(name, "name");
34
}
35
36
public String getName() {
0 commit comments