APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.constant

public final Class ClassOrInterfaceDescImpl

extends Object
implements ClassDesc
Class Inheritance
All Implemented Interfaces
java.lang.constant.ClassDesc, java.lang.invoke.TypeDescriptor.OfField, java.lang.invoke.TypeDescriptor, java.lang.constant.ConstantDesc
Imports
java.lang.constant.ClassDesc, java.lang.invoke.MethodHandles, jdk.internal.vm.annotation.Stable

A class or interface descriptor. Restrictions:

Field Summary

Modifier and TypeField and Description
private final String
private String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ClassDesc
arrayType(int rank)

Implements java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type of the specified rank, whose component type is described by this ClassDesc.

public ClassDesc
arrayType()

Implements java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type whose component type is described by this ClassDesc.

public String
descriptorString()

Implements java.lang.constant.ClassDesc.descriptorString.

Returns a field type descriptor string for this type

public String
displayName()

Implements java.lang.constant.ClassDesc.displayName.

Returns a human-readable name for this ClassDesc.

public boolean

Returns:

true if the specified ClassDesc is equal to this ClassDesc.
equals
(Object
the ClassDesc to compare to this ClassDesc
o
)

Overrides java.lang.Object.equals.

Implements java.lang.constant.ClassDesc.equals.

Returns true if this ClassOrInterfaceDescImpl is equal to another ClassOrInterfaceDescImpl.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
public boolean
isClassOrInterface()

Overrides default java.lang.constant.ClassDesc.isClassOrInterface.

Returns whether this ClassDesc describes a class or interface type.

public ClassDesc
nested(String nestedName)

Overrides default java.lang.constant.ClassDesc.nested.

Returns a ClassDesc for a nested class of the class or interface type described by this ClassDesc.

public ClassDesc
nested(String firstNestedName, String... moreNestedNames)

Overrides default java.lang.constant.ClassDesc.nested.

Returns a ClassDesc for a nested class of the class or interface type described by this ClassDesc.

public static ClassOrInterfaceDescImpl
ofValidated(String descriptor)

Creates a ClassOrInterfaceDescImpl from a pre-validated descriptor string for a class or interface.

public String
packageName()

Overrides default java.lang.constant.ClassDesc.packageName.

Returns the package name of this ClassDesc, if it describes a class or interface type.

public Class<?>
resolveConstantDesc(MethodHandles.Lookup lookup)

Implements java.lang.constant.ClassDesc.resolveConstantDesc.

Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

descriptorback to summary
private final String descriptor
internalNameback to summary
private String internalName
Annotations
@Stable

Constructor Detail

ClassOrInterfaceDescImplback to summary
pack-priv ClassOrInterfaceDescImpl(String descriptor)

Method Detail

arrayTypeback to summary
public ClassDesc arrayType(int rank)

Implements java.lang.constant.ClassDesc.arrayType.

Doc from java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type of the specified rank, whose component type is described by this ClassDesc.

Annotations
@Override
arrayTypeback to summary
public ClassDesc arrayType()

Implements java.lang.constant.ClassDesc.arrayType.

Doc from java.lang.constant.ClassDesc.arrayType.

Returns a ClassDesc for an array type whose component type is described by this ClassDesc.

Annotations
@Override
descriptorStringback to summary
public String descriptorString()

Implements java.lang.constant.ClassDesc.descriptorString.

Doc from java.lang.constant.ClassDesc.descriptorString.

Returns a field type descriptor string for this type

Annotations
@Override
displayNameback to summary
public String displayName()

Implements java.lang.constant.ClassDesc.displayName.

Doc from java.lang.constant.ClassDesc.displayName.

Returns a human-readable name for this ClassDesc. For primitive types, this method returns the simple name (such as int). For class or interface types, this method returns the unqualified class name. For array types, this method returns the human-readable name of the component type suffixed with the appropriate number of [] pairs.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.lang.constant.ClassDesc.equals.

Returns true if this ClassOrInterfaceDescImpl is equal to another ClassOrInterfaceDescImpl. Equality is determined by the two class descriptors having equal class descriptor strings.

Parameters
o:Object

the ClassDesc to compare to this ClassDesc

Returns:boolean

true if the specified ClassDesc is equal to this ClassDesc.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
internalNameback to summary
public String internalName()
isClassOrInterfaceback to summary
public boolean isClassOrInterface()

Overrides default java.lang.constant.ClassDesc.isClassOrInterface.

Doc from java.lang.constant.ClassDesc.isClassOrInterface.

Returns whether this ClassDesc describes a class or interface type.

Annotations
@Override
nestedback to summary
public ClassDesc nested(String nestedName)

Overrides default java.lang.constant.ClassDesc.nested.

Doc from java.lang.constant.ClassDesc.nested.

Returns a ClassDesc for a nested class of the class or interface type described by this ClassDesc.

Annotations
@Override
nestedback to summary
public ClassDesc nested(String firstNestedName, String... moreNestedNames)

Overrides default java.lang.constant.ClassDesc.nested.

Doc from java.lang.constant.ClassDesc.nested.

Returns a ClassDesc for a nested class of the class or interface type described by this ClassDesc.

Annotations
@Override
ofValidatedback to summary
public static ClassOrInterfaceDescImpl ofValidated(String descriptor)

Creates a ClassOrInterfaceDescImpl from a pre-validated descriptor string for a class or interface.

packageNameback to summary
public String packageName()

Overrides default java.lang.constant.ClassDesc.packageName.

Doc from java.lang.constant.ClassDesc.packageName.

Returns the package name of this ClassDesc, if it describes a class or interface type.

Annotations
@Override
resolveConstantDescback to summary
public Class<?> resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException

Implements java.lang.constant.ClassDesc.resolveConstantDesc.

Doc from java.lang.constant.ConstantDesc.resolveConstantDesc.

Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution and access control context is provided by the MethodHandles.Lookup parameter. No caching of the resulting value is performed.

Annotations
@Override
Exceptions
ReflectiveOperationException:
if a class, method, or field could not be reflectively resolved in the course of resolution
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override