Record Class AllocatesDynamicAnnotation
java.lang.Object
java.lang.Record
org.elasticsearch.painless.spi.annotation.AllocatesDynamicAnnotation
- Record Components:
estimatorClassName- fully-qualified binary class name declaring the estimatorestimatorMethodName- name of the estimator method
public record AllocatesDynamicAnnotation(String estimatorClassName, String estimatorMethodName)
extends Record
Marks an allowlisted constructor or method whose allocation size depends on its arguments. An estimator — a
public static long method taking the target's full Java signature (receiver first for instance methods) — is invoked
at runtime and its result charged against the per-context allocation limit before the call executes. The estimator is named
by its class (fully-qualified binary name; JVM $ form for inner classes) and method, resolved at
allowlist load time through the annotated class's class loader so plugins may ship their own.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAllocatesDynamicAnnotation(String estimatorClassName, String estimatorMethodName) Creates an instance of aAllocatesDynamicAnnotationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theestimatorClassNamerecord component.Returns the value of theestimatorMethodNamerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
AllocatesDynamicAnnotation
Creates an instance of aAllocatesDynamicAnnotationrecord class.- Parameters:
estimatorClassName- the value for theestimatorClassNamerecord componentestimatorMethodName- the value for theestimatorMethodNamerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
estimatorClassName
Returns the value of theestimatorClassNamerecord component.- Returns:
- the value of the
estimatorClassNamerecord component
-
estimatorMethodName
Returns the value of theestimatorMethodNamerecord component.- Returns:
- the value of the
estimatorMethodNamerecord component
-