Record Class AllocatesConstantAnnotation
java.lang.Object
java.lang.Record
org.elasticsearch.painless.spi.annotation.AllocatesConstantAnnotation
Marks an allowlisted constructor or method that allocates a fixed number of
bytes, charged against the per-context
allocation limit before the call executes. The declared cost is the total heap allocation attributable to the call,
including transitive JDK-internal allocations. Use AllocatesDynamicAnnotation when the size is argument-dependent.
0 is a valid no-op ("audited: does not allocate") and emits no pre-check; negatives are rejected at allowlist load time.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAllocatesConstantAnnotation(long bytes) Creates an instance of aAllocatesConstantAnnotationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongbytes()Returns the value of thebytesrecord component.final booleanIndicates whether some other object is "equal to" this one.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
-
AllocatesConstantAnnotation
public AllocatesConstantAnnotation(long bytes) Creates an instance of aAllocatesConstantAnnotationrecord class.- Parameters:
bytes- the value for thebytesrecord 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 with '=='. -
bytes
public long bytes()Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-