Module org.elasticsearch.xcore
Record Class RegionPolicyDoc
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.inference.regionpolicy.RegionPolicyDoc
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public record RegionPolicyDoc(RegionPolicy regionPolicy, Instant createdAt, String createdBy, Instant updatedAt, String updatedBy)
extends Record
implements ToXContentObject, Writeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseFieldstatic final ParseFieldstatic final StringThe document id for region policies.static final ConstructingObjectParser<RegionPolicyDoc, Void> static final ParseFieldstatic final ConstructingObjectParser<RegionPolicyDoc, Void> static final ParseFieldstatic final ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionRegionPolicyDoc(RegionPolicy regionPolicy, Instant createdAt, String createdBy, Instant updatedAt, String updatedBy) Creates an instance of aRegionPolicyDocrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAtrecord component.Returns the value of thecreatedByrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theregionPolicyrecord component.final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) Returns the value of theupdatedAtrecord component.Returns the value of theupdatedByrecord component.voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
REGION_POLICY_FIELD
-
CREATED_AT_FIELD
-
CREATED_BY_FIELD
-
UPDATED_AT_FIELD
-
UPDATED_BY_FIELD
-
DOCUMENT_ID
The document id for region policies. We currently only support region policy for the elastic inference service. We add "elastic" to the document id to avoid conflicts with other inference services in the future.- See Also:
-
STRICT_PARSER
-
LENIENT_PARSER
-
-
Constructor Details
-
RegionPolicyDoc
- Throws:
IOException
-
RegionPolicyDoc
public RegionPolicyDoc(RegionPolicy regionPolicy, Instant createdAt, @Nullable String createdBy, @Nullable Instant updatedAt, @Nullable String updatedBy) Creates an instance of aRegionPolicyDocrecord class.- Parameters:
regionPolicy- the value for theregionPolicyrecord componentcreatedAt- the value for thecreatedAtrecord componentcreatedBy- the value for thecreatedByrecord componentupdatedAt- the value for theupdatedAtrecord componentupdatedBy- the value for theupdatedByrecord component
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
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). -
regionPolicy
Returns the value of theregionPolicyrecord component.- Returns:
- the value of the
regionPolicyrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
createdBy
Returns the value of thecreatedByrecord component.- Returns:
- the value of the
createdByrecord component
-
updatedAt
Returns the value of theupdatedAtrecord component.- Returns:
- the value of the
updatedAtrecord component
-
updatedBy
Returns the value of theupdatedByrecord component.- Returns:
- the value of the
updatedByrecord component
-