Interface Name
- All Superinterfaces:
CharSequence
public interface Name extends CharSequence
Name objects from the same implementation are usable in collections while Names 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.
- Since:
- 1.6
- See Also:
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
contentEquals |
Compares this name to the specified CharSequence. |
boolean |
equals |
Returns true if the argument represents the same name as this, and false otherwise. |
int |
hashCode() |
Obeys the general contract of Object.hashCode. |
Methods declared in interface java.lang.CharSequence
charAt, chars, codePoints, isEmpty, length, subSequence, toString
Method Details
equals
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.
hashCode
int hashCode()
Object.hashCode.contentEquals
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.- Parameters:
-
cs- The sequence to compare this name against - Returns:
-
trueif this name represents the same sequence ofcharvalues as the specified sequence,falseotherwise - See Also:
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.compiler/javax/lang/model/element/Name.html