APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.lang.reflect

public abstract sealed Class Executable

extends AccessibleObject
implements Member, GenericDeclaration
permits Constructor<T>, Method
Class Inheritance
All Implemented Interfaces
java.lang.reflect.GenericDeclaration, java.lang.reflect.AnnotatedElement, java.lang.reflect.Member
Known Direct Subclasses
java.lang.reflect.Method, java.lang.reflect.Constructor
Imports
java.lang.annotation.Annotation, java.util.Arrays, .Map, .Set, .Objects, .StringJoiner, java.util.stream.Collectors, jdk.internal.access.SharedSecrets, jdk.internal.vm.annotation.Stable, sun.reflect.annotation.AnnotationParser, .AnnotationSupport, .TypeAnnotationParser, .TypeAnnotation, sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl, sun.reflect.generics.repository.ConstructorRepository

A shared superclass for the common functionality of Method and Constructor.
Since
1.8

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static record

Field Summary

Modifier and TypeField and Description
private transient volatile Map<Class<? extends Annotation>, Annotation>
private transient Executable.ParameterData
Inherited from java.lang.reflect.AccessibleObject:
accessCheckCacheoverridereflectionFactory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Set<AccessFlag>

Returns:

an unmodifiable set of the access flags for the executable represented by this object, possibly empty
accessFlags
()

Overrides default java.lang.reflect.Member.accessFlags.

Returns an unmodifiable set of the access flags for the executable represented by this object, possibly empty.

pack-priv abstract void
private Map<Class<? extends Annotation>, Annotation>
pack-priv boolean
equalParamTypes(Class<?>[] params1, Class<?>[] params2)

pack-priv Type[]
getAllGenericParameterTypes()

Behaves like getGenericParameterTypes, but returns type information for all parameters, including synthetic parameters.

public AnnotatedType[]

Returns:

an array of objects representing the declared exceptions of the method or constructor represented by this Executable
getAnnotatedExceptionTypes
()

Returns an array of AnnotatedType objects that represent the use of types to specify the declared exceptions of the method/constructor represented by this Executable.

public AnnotatedType[]

Returns:

an array of objects representing the types of the formal parameters of the method or constructor represented by this Executable
getAnnotatedParameterTypes
()

Returns an array of AnnotatedType objects that represent the use of types to specify formal parameter types of the method/constructor represented by this Executable.

public AnnotatedType

Returns:

an object representing the receiver type of the method or constructor represented by this Executable or null if this Executable can not have a receiver parameter
getAnnotatedReceiverType
()

Returns an AnnotatedType object that represents the use of a type to specify the receiver type of the method/constructor represented by this Executable object.

public abstract AnnotatedType

Returns:

an object representing the return type of the method or constructor represented by this Executable
getAnnotatedReturnType
()

Returns an AnnotatedType object that represents the use of a type to specify the return type of the method/constructor represented by this Executable.

pack-priv AnnotatedType
public <T extends Annotation> T
getAnnotation(Class<T> annotationClass)

Overrides java.lang.reflect.AccessibleObject.getAnnotation.

Implements java.lang.reflect.AnnotatedElement.getAnnotation.

Returns this element's annotation for the specified type if such an annotation is present, else null.

pack-priv abstract byte[]
getAnnotationBytes()

Accessor method to allow code sharing

public <T extends Annotation> T[]
getAnnotationsByType(Class<T> annotationClass)

Overrides java.lang.reflect.AccessibleObject.getAnnotationsByType.

Overrides default java.lang.reflect.AnnotatedElement.getAnnotationsByType.

Returns annotations that are associated with this element.

public Annotation[]
public abstract Class<?>
getDeclaringClass()

Redeclares java.lang.reflect.Member.getDeclaringClass.

Returns the Class object representing the class or interface that declares the executable represented by this object.

public abstract Class<?>[]

Returns:

the exception types declared as being thrown by the executable this object represents
getExceptionTypes
()

Returns an array of Class objects that represent the types of exceptions declared to be thrown by the underlying executable represented by this object.

public Type[]

Returns:

an array of Types that represent the exception types thrown by the underlying executable
getGenericExceptionTypes
()

Returns an array of Type objects that represent the exceptions declared to be thrown by this executable object.

pack-priv abstract ConstructorRepository
public Type[]

Returns:

an array of Types that represent the formal parameter types of the underlying executable, in declaration order
getGenericParameterTypes
()

Returns an array of Type objects that represent the formal parameter types, in declaration order, of the executable represented by this object.

public abstract int

Returns:

the Java language modifiers for the executable represented by this object
getModifiers
()

Redeclares java.lang.reflect.Member.getModifiers.

Returns the Java language modifiers for the executable represented by this object.

public abstract String
getName()

Redeclares java.lang.reflect.Member.getName.

Returns the name of the executable represented by this object.

public abstract Annotation[][]

Returns:

an array of arrays that represent the annotations on the formal and implicit parameters, in declaration order, of the executable represented by this object
getParameterAnnotations
()

Returns an array of arrays of Annotations that represent the annotations on the formal parameters, in declaration order, of the Executable represented by this object.

public abstract int

Returns:

The number of formal parameters for the executable this object represents
getParameterCount
()

Returns the number of formal parameters (whether explicitly declared or implicitly declared or neither) for the executable represented by this object.

public Parameter[]

Returns:

an array of Parameter objects representing all the parameters to the underlying executable represented by this object
getParameters
()

Returns an array of Parameter objects representing all the parameters to the underlying executable represented by this object.

private native Parameter[]
public abstract Class<?>[]

Returns:

the parameter types for the executable this object represents
getParameterTypes
()

Returns an array of Class objects that represent the formal parameter types, in declaration order, of the executable represented by this object.

pack-priv abstract Class<?>[]
pack-priv abstract Class<?>[]
pack-priv byte[]
pack-priv native byte[]
public abstract TypeVariable<?>[]

Returns:

an array of TypeVariable objects that represent the type variables declared by this generic declaration
getTypeParameters
()

Redeclares java.lang.reflect.GenericDeclaration.getTypeParameters.

Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order.

pack-priv abstract boolean
handleParameterNumberMismatch(int resultLength, Class<?>[] parameterTypes)

pack-priv abstract boolean
hasGenericInformation()

Does the Executable have generic information.

pack-priv boolean
public boolean

Returns:

true if and only if this executable is a synthetic construct as defined by The Java Language Specification.
isSynthetic
()

Implements java.lang.reflect.Member.isSynthetic.

Returns true if this executable is a synthetic construct; returns false otherwise.

public boolean

Returns:

true if this executable was declared to take a variable number of arguments; returns false otherwise
isVarArgs
()

Returns true if this executable was declared to take a variable number of arguments; returns false otherwise.

private Executable.ParameterData
pack-priv Type
pack-priv Annotation[][]
parseParameterAnnotations(byte[] parameterAnnotations)

pack-priv Annotation[][]
sharedGetParameterAnnotations(Class<?>[] parameterTypes, byte[] parameterAnnotations)

pack-priv String
pack-priv String
sharedToString(Class<?>[] parameterTypes, Class<?>[] exceptionTypes)

pack-priv abstract void
specificToGenericStringHeader(StringBuilder sb)

Generate toGenericString header information specific to a method or constructor.

pack-priv abstract void
specificToStringHeader(StringBuilder sb)

Generate toString header information specific to a method or constructor.

private Parameter[]
public String

Returns:

a string describing this Executable, including any type parameters
toGenericString
()

Returns a string describing this Executable, including any type parameters.

pack-priv static String
private void
verifyParameters(final Parameter[] parameters)

Inherited from java.lang.reflect.AccessibleObject:
canAccesscheckAccesscheckCanSetAccessiblecheckCanSetAccessiblegetAnnotationsgetDeclaredAnnotationgetDeclaredAnnotationsByTypegetRootisAccessibleisAnnotationPresentsetAccessiblesetAccessiblesetAccessible0toShortStringtrySetAccessibleverifyAccess

Field Detail

declaredAnnotationsback to summary
private transient volatile Map<Class<? extends Annotation>, Annotation> declaredAnnotations
parameterDataback to summary
private transient Executable.ParameterData parameterData
Annotations
@Stable

Constructor Detail

Executableback to summary
pack-priv Executable()
Annotations
@SuppressWarnings:deprecation

Method Detail

accessFlagsback to summary
public Set<AccessFlag> accessFlags()

Overrides default java.lang.reflect.Member.accessFlags.

Returns an unmodifiable set of the access flags for the executable represented by this object, possibly empty.

Returns:Set<AccessFlag>

an unmodifiable set of the access flags for the executable represented by this object, possibly empty

Annotations
@Override
Since
20
Java Virtual Machine Specification
4.6 Methods
See Also
getModifiers()
appendModifiersback to summary
pack-priv abstract void appendModifiers(StringBuilder sb)
declaredAnnotationsback to summary
private Map<Class<? extends Annotation>, Annotation> declaredAnnotations()
equalParamTypesback to summary
pack-priv boolean equalParamTypes(Class<?>[] params1, Class<?>[] params2)
getAllGenericParameterTypesback to summary
pack-priv Type[] getAllGenericParameterTypes()

Behaves like getGenericParameterTypes, but returns type information for all parameters, including synthetic parameters.

getAnnotatedExceptionTypesback to summary
public AnnotatedType[] getAnnotatedExceptionTypes()

Returns an array of AnnotatedType objects that represent the use of types to specify the declared exceptions of the method/constructor represented by this Executable. The order of the objects in the array corresponds to the order of the exception types in the declaration of the method/constructor. Returns an array of length 0 if the method/constructor declares no exceptions.

Returns:AnnotatedType[]

an array of objects representing the declared exceptions of the method or constructor represented by this Executable

getAnnotatedParameterTypesback to summary
public AnnotatedType[] getAnnotatedParameterTypes()

Returns an array of AnnotatedType objects that represent the use of types to specify formal parameter types of the method/constructor represented by this Executable. The order of the objects in the array corresponds to the order of the formal parameter types in the declaration of the method/constructor. Returns an array of length 0 if the method/constructor declares no parameters. Note that the constructors of some inner classes may have an implicitly declared parameter in addition to explicitly declared ones. Also note that compact constructors of a record class may have implicitly declared parameters.

Returns:AnnotatedType[]

an array of objects representing the types of the formal parameters of the method or constructor represented by this Executable

Annotations
@SuppressWarnings:doclint:reference
getAnnotatedReceiverTypeback to summary
public AnnotatedType getAnnotatedReceiverType()

Returns an AnnotatedType object that represents the use of a type to specify the receiver type of the method/constructor represented by this Executable object. The receiver type of a method/constructor is available only if the method/constructor has a receiver parameter (JLS 8.4.1). If this Executable object represents an instance method or represents a constructor of an inner member class, and the method/constructor either has no receiver parameter or has a receiver parameter with no annotations on its type, then the return value is an AnnotatedType object representing an element with no annotations. If this Executable object represents a static method or represents a constructor of a top level, static member, local, or anonymous class, then the return value is null.

Returns:AnnotatedType

an object representing the receiver type of the method or constructor represented by this Executable or null if this Executable can not have a receiver parameter

Java Language Specification
8.4 Method Declarations, 8.4.1 Formal Parameters, 8.8 Constructor Declarations
getAnnotatedReturnTypeback to summary
public abstract AnnotatedType getAnnotatedReturnType()

Returns an AnnotatedType object that represents the use of a type to specify the return type of the method/constructor represented by this Executable. If this Executable object represents a constructor, the AnnotatedType object represents the type of the constructed object. If this Executable object represents a method, the AnnotatedType object represents the use of a type to specify the return type of the method.

Returns:AnnotatedType

an object representing the return type of the method or constructor represented by this Executable

getAnnotatedReturnType0back to summary
pack-priv AnnotatedType getAnnotatedReturnType0(Type returnType)
getAnnotationback to summary
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)

Overrides java.lang.reflect.AccessibleObject.getAnnotation.

Implements java.lang.reflect.AnnotatedElement.getAnnotation.

Doc from java.lang.reflect.AnnotatedElement.getAnnotation.

Returns this element's annotation for the specified type if such an annotation is present, else null.

Annotations
@Override
Exceptions
NullPointerException:
if the given annotation class is null
getAnnotationBytesback to summary
pack-priv abstract byte[] getAnnotationBytes()

Accessor method to allow code sharing

getAnnotationsByTypeback to summary
public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass)

Overrides java.lang.reflect.AccessibleObject.getAnnotationsByType.

Overrides default java.lang.reflect.AnnotatedElement.getAnnotationsByType.

Doc from java.lang.reflect.AnnotatedElement.getAnnotationsByType.

Returns annotations that are associated with this element. If there are no annotations associated with this element, the return value is an array of length 0. The difference between this method and getAnnotation(Class) is that this method detects if its argument is a repeatable annotation type (JLS 9.6), and if so, attempts to find one or more annotations of that type by "looking through" a container annotation. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.

Annotations
@Override
Exceptions
NullPointerException:
if the given annotation class is null
getDeclaredAnnotationsback to summary
public Annotation[] getDeclaredAnnotations()

Overrides java.lang.reflect.AccessibleObject.getDeclaredAnnotations.

Implements java.lang.reflect.AnnotatedElement.getDeclaredAnnotations.

Doc from java.lang.reflect.AnnotatedElement.getDeclaredAnnotations.

Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.

Annotations
@Override
getDeclaringClassback to summary
public abstract Class<?> getDeclaringClass()

Redeclares java.lang.reflect.Member.getDeclaringClass.

Returns the Class object representing the class or interface that declares the executable represented by this object.

getExceptionTypesback to summary
public abstract Class<?>[] getExceptionTypes()

Returns an array of Class objects that represent the types of exceptions declared to be thrown by the underlying executable represented by this object. Returns an array of length 0 if the executable declares no exceptions in its throws clause.

Returns:Class<?>[]

the exception types declared as being thrown by the executable this object represents

getGenericExceptionTypesback to summary
public Type[] getGenericExceptionTypes()

Returns an array of Type objects that represent the exceptions declared to be thrown by this executable object. Returns an array of length 0 if the underlying executable declares no exceptions in its throws clause.

If an exception type is a type variable or a parameterized type, it is created. Otherwise, it is resolved.

Returns:Type[]

an array of Types that represent the exception types thrown by the underlying executable

Exceptions
GenericSignatureFormatError:
if the generic method signature does not conform to the format specified in The Java Virtual Machine Specification
TypeNotPresentException:
if the underlying executable's throws clause refers to a non-existent type declaration
MalformedParameterizedTypeException:
if the underlying executable's throws clause refers to a parameterized type that cannot be instantiated for any reason
getGenericInfoback to summary
pack-priv abstract ConstructorRepository getGenericInfo()
getGenericParameterTypesback to summary
public Type[] getGenericParameterTypes()

Returns an array of Type objects that represent the formal parameter types, in declaration order, of the executable represented by this object. An array of length 0 is returned if the underlying executable takes no parameters. Note that the constructors of some inner classes may have an implicitly declared parameter in addition to explicitly declared ones. Compact constructors of a record class may also have implicitly declared parameters, but they are a special case and thus considered as if they had been explicitly declared in the source. Finally note that as a modeling artifact, the number of returned parameters can differ depending on whether or not generic information is present. If generic information is present, parameters explicitly present in the source or parameters of compact constructors of a record class will be returned. Note that parameters of compact constructors of a record class are a special case, as they are not explicitly present in the source, and its type will be returned regardless of the parameters being implicitly declared or not. If generic information is not present, implicit and synthetic parameters may be returned as well.

If a formal parameter type is a parameterized type, the Type object returned for it must accurately reflect the actual type arguments used in the source code. This assertion also applies to the parameters of compact constructors of a record class, independently of them being implicitly declared or not.

If a formal parameter type is a type variable or a parameterized type, it is created. Otherwise, it is resolved.

Returns:Type[]

an array of Types that represent the formal parameter types of the underlying executable, in declaration order

Annotations
@SuppressWarnings:doclint:reference
Exceptions
GenericSignatureFormatError:
if the generic method signature does not conform to the format specified in The Java Virtual Machine Specification
TypeNotPresentException:
if any of the parameter types of the underlying executable refers to a non-existent type declaration
MalformedParameterizedTypeException:
if any of the underlying executable's parameter types refer to a parameterized type that cannot be instantiated for any reason
getModifiersback to summary
public abstract int getModifiers()

Redeclares java.lang.reflect.Member.getModifiers.

Returns the Java language modifiers for the executable represented by this object.

Returns:int

the Java language modifiers for the executable represented by this object

See Also
accessFlags
getNameback to summary
public abstract String getName()

Redeclares java.lang.reflect.Member.getName.

Returns the name of the executable represented by this object.

getParameterAnnotationsback to summary
public abstract Annotation[][] getParameterAnnotations()

Returns an array of arrays of Annotations that represent the annotations on the formal parameters, in declaration order, of the Executable represented by this object. Synthetic and mandated parameters (see explanation below), such as the outer "this" parameter to an inner class constructor will be represented in the returned array. If the executable has no parameters (meaning no formal, no synthetic, and no mandated parameters), a zero-length array will be returned. If the Executable has one or more parameters, a nested array of length zero is returned for each parameter with no annotations. The annotation objects contained in the returned arrays are serializable. The caller of this method is free to modify the returned arrays; it will have no effect on the arrays returned to other callers. A compiler may add extra parameters that are implicitly declared in source ("mandated"), as well as parameters that are neither implicitly nor explicitly declared in source ("synthetic") to the parameter list for a method. See java.lang.reflect.Parameter for more information.

Note that any annotations returned by this method are declaration annotations.

Returns:Annotation[][]

an array of arrays that represent the annotations on the formal and implicit parameters, in declaration order, of the executable represented by this object

See Also
java.lang.reflect.Parameter, java.lang.reflect.Parameter#getAnnotations
getParameterCountback to summary
public abstract int getParameterCount()

Returns the number of formal parameters (whether explicitly declared or implicitly declared or neither) for the executable represented by this object.

Returns:int

The number of formal parameters for the executable this object represents

getParametersback to summary
public Parameter[] getParameters()

Returns an array of Parameter objects representing all the parameters to the underlying executable represented by this object. An array of length 0 is returned if the executable has no parameters.

The parameters of the underlying executable do not necessarily have unique names, or names that are legal identifiers in the Java programming language (JLS 3.8).

Returns:Parameter[]

an array of Parameter objects representing all the parameters to the underlying executable represented by this object

Exceptions
MalformedParametersException:
if the class file contains a MethodParameters attribute that is improperly formatted.
getParameters0back to summary
private native Parameter[] getParameters0()
getParameterTypesback to summary
public abstract Class<?>[] getParameterTypes()

Returns an array of Class objects that represent the formal parameter types, in declaration order, of the executable represented by this object. Returns an array of length 0 if the underlying executable takes no parameters. Note that the constructors of some inner classes may have an implicitly declared parameter in addition to explicitly declared ones. Also note that compact constructors of a record class may have implicitly declared parameters.

Returns:Class<?>[]

the parameter types for the executable this object represents

Annotations
@SuppressWarnings:doclint:reference
getSharedExceptionTypesback to summary
pack-priv abstract Class<?>[] getSharedExceptionTypes()
getSharedParameterTypesback to summary
pack-priv abstract Class<?>[] getSharedParameterTypes()
getTypeAnnotationBytesback to summary
pack-priv byte[] getTypeAnnotationBytes()
getTypeAnnotationBytes0back to summary
pack-priv native byte[] getTypeAnnotationBytes0()
getTypeParametersback to summary
public abstract TypeVariable<?>[] getTypeParameters()

Redeclares java.lang.reflect.GenericDeclaration.getTypeParameters.

Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order. Returns an array of length 0 if the underlying generic declaration declares no type variables.

Returns:TypeVariable<?>[]

an array of TypeVariable objects that represent the type variables declared by this generic declaration

Exceptions
GenericSignatureFormatError:
if the generic signature of this generic declaration does not conform to the format specified in The Java Virtual Machine Specification
handleParameterNumberMismatchback to summary
pack-priv abstract boolean handleParameterNumberMismatch(int resultLength, Class<?>[] parameterTypes)
hasGenericInformationback to summary
pack-priv abstract boolean hasGenericInformation()

Does the Executable have generic information.

hasRealParameterDataback to summary
pack-priv boolean hasRealParameterData()
isSyntheticback to summary
public boolean isSynthetic()

Implements java.lang.reflect.Member.isSynthetic.

Returns true if this executable is a synthetic construct; returns false otherwise.

Returns:boolean

true if and only if this executable is a synthetic construct as defined by The Java Language Specification.

Java Language Specification
13.1 The Form of a Binary
Java Virtual Machine Specification
4.6 Methods
isVarArgsback to summary
public boolean isVarArgs()

Returns true if this executable was declared to take a variable number of arguments; returns false otherwise.

Returns:boolean

true if this executable was declared to take a variable number of arguments; returns false otherwise

parameterDataback to summary
private Executable.ParameterData parameterData()
parameterizeback to summary
pack-priv Type parameterize(Class<?> c)
parseParameterAnnotationsback to summary
pack-priv Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations)
sharedGetParameterAnnotationsback to summary
pack-priv Annotation[][] sharedGetParameterAnnotations(Class<?>[] parameterTypes, byte[] parameterAnnotations)
sharedToGenericStringback to summary
pack-priv String sharedToGenericString()
sharedToStringback to summary
pack-priv String sharedToString(Class<?>[] parameterTypes, Class<?>[] exceptionTypes)
specificToGenericStringHeaderback to summary
pack-priv abstract void specificToGenericStringHeader(StringBuilder sb)

Generate toGenericString header information specific to a method or constructor.

specificToStringHeaderback to summary
pack-priv abstract void specificToStringHeader(StringBuilder sb)

Generate toString header information specific to a method or constructor.

synthesizeAllParamsback to summary
private Parameter[] synthesizeAllParams()
toGenericStringback to summary
public String toGenericString()

Returns a string describing this Executable, including any type parameters.

Returns:String

a string describing this Executable, including any type parameters

typeVarBoundsback to summary
pack-priv static String typeVarBounds(TypeVariable<?> typeVar)
verifyParametersback to summary
private void verifyParameters(final Parameter[] parameters)
java.lang.reflect back to summary

pack-priv final Record Executable.ParameterData

extends Record
Class Inheritance
Record Components
parameters:Parameter[] 
isReal:boolean 

Field Summary

Modifier and TypeField and Description
private final boolean
isReal

Record Component accessed by isReal().

private final Parameter[]
parameters

Record Component accessed by parameters().

Constructor Summary

AccessConstructor and Description
pack-priv
ParameterData(Parameter[] parameters, boolean isReal)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public boolean
isReal()

Record Component getter of isReal.

public Parameter[]
parameters()

Record Component getter of parameters.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

isRealback to summary
private final boolean isReal

Record Component accessed by isReal().

parametersback to summary
private final Parameter[] parameters

Record Component accessed by parameters().

Annotations
@Stable

Constructor Detail

ParameterDataback to summary
pack-priv ParameterData(Parameter[] parameters, boolean isReal)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

isRealback to summary
public boolean isReal()

Record Component getter of isReal.

parametersback to summary
public Parameter[] parameters()

Record Component getter of parameters.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.