public interface Name extends CharSequence
Name
objects from the same
implementation are usable in collections while Name
s from
different implementations may not work properly in collections.
An empty Name
has a length of zero.
In the context of annotation processing, the guarantees for "the same" implementation must include contexts where the API mediated side effects of processors could be visible to each other, including successive annotation processing rounds.
Elements.getName(java.lang.CharSequence)
Modifier and Type | Method and Description |
---|---|
boolean |
contentEquals(CharSequence cs)
Compares this name to the specified
CharSequence . |
boolean |
equals(Object obj)
Returns
true if the argument represents the same
name as this , and false otherwise. |
int |
hashCode()
Obeys the general contract of
Object.hashCode . |
charAt, chars, codePoints, length, subSequence, toString
boolean equals(Object obj)
true
if the argument represents the same
name as this
, and false
otherwise.
Note that the identity of a Name
is a function both
of its content in terms of a sequence of characters as well as
the implementation which created it.
equals
in class Object
obj
- the object to be compared with this elementtrue
if the specified object represents the same
name as thisElement.equals(java.lang.Object)
int hashCode()
Object.hashCode
.hashCode
in class Object
equals(java.lang.Object)
boolean contentEquals(CharSequence cs)
CharSequence
. The result
is true
if and only if this name represents the same sequence
of char
values as the specified sequence.cs
- The sequence to compare this name againsttrue
if this name represents the same sequence
of char
values as the specified sequence, false
otherwiseString.contentEquals(CharSequence)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.