< prev index next >

src/java.compiler/share/classes/javax/lang/model/element/Name.java

Print this page

        

@@ -50,10 +50,24 @@
  * @see javax.lang.model.util.Elements#getName
  * @since 1.6
  */
 public interface Name extends CharSequence {
     /**
+     * Returns {@code true} if this is an empty name with a length of
+     * zero; returns {@code false} otherwise.
+     * @return {@code true} for an empty name and {@code false} otherwise.
+     *
+     * @implSpec Returns the result of calling {@link
+     * CharSequence#isEmpty() CharSequence.isEmpty()}.
+     * @since 16
+     */
+    @Override
+    default boolean isEmpty() {
+        return CharSequence.super.isEmpty();
+    }
+
+    /**
      * Returns {@code true} if the argument represents the same
      * name as {@code this}, and {@code false} otherwise.
      *
      * <p>Note that the identity of a {@code Name} is a function both
      * of its content in terms of a sequence of characters as well as
< prev index next >