File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/org/comroid/api Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1010public interface Named extends WrappedFormattable {
1111 /**
1212 * Default implementation to get the primary name.
13- * If this is an instance of {@link Enum}, returns its {@link Enum#name() enum constant name }.
13+ * By default, invokes {@link #getName() }.
1414 *
1515 * @return The primary name.
1616 */
1717 @ Override
1818 default String getPrimaryName () {
19- if (this instanceof Enum )
20- return ((Enum <?>) this ).name ();
21- return getAlternateName ();
19+ return getName ();
2220 }
2321
2422 /**
@@ -33,12 +31,14 @@ default String getAlternateName() {
3331
3432 /**
3533 * Returns the primary common name of this object.
36- * By default, invokes {@link #getPrimaryName() }.
34+ * If this is an instance of {@link Enum}, returns its {@link Enum#name() enum constant name }.
3735 *
3836 * @return the primary common name.
3937 */
4038 default String getName () {
41- return getPrimaryName ();
39+ if (this instanceof Enum )
40+ return ((Enum <?>) this ).name ();
41+ return toString ();
4242 }
4343
4444 /**
You can’t perform that action at this time.
0 commit comments