Record Class TimeSpan
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.action.TimeSpan
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public record TimeSpan(long startMillis, long startNanos, long stopMillis, long stopNanos)
extends Record
implements Writeable, org.elasticsearch.xcontent.ToXContentObject
THis class is used to capture a duration of some process, including start and stop point int time.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTimeSpan(long startMillis, long startNanos, long stopMillis, long stopNanos) Creates an instance of aTimeSpanrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlonglongfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static TimeSpanreadFrom(StreamInput in) static TimeSpan.Builderstart()longReturns the value of thestartMillisrecord component.longReturns the value of thestartNanosrecord component.longReturns the value of thestopMillisrecord component.longReturns the value of thestopNanosrecord component.final StringtoString()Returns a string representation of this record class.org.elasticsearch.core.TimeValueorg.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) 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
-
Constructor Details
-
TimeSpan
public TimeSpan(long startMillis, long startNanos, long stopMillis, long stopNanos) Creates an instance of aTimeSpanrecord class.- Parameters:
startMillis- the value for thestartMillisrecord componentstartNanos- the value for thestartNanosrecord componentstopMillis- the value for thestopMillisrecord componentstopNanos- the value for thestopNanosrecord component
-
-
Method Details
-
readFrom
- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
toTimeValue
public org.elasticsearch.core.TimeValue toTimeValue() -
durationInMillis
public long durationInMillis() -
durationInNanos
public long durationInNanos() -
start
-
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 '=='. -
startMillis
public long startMillis()Returns the value of thestartMillisrecord component.- Returns:
- the value of the
startMillisrecord component
-
startNanos
public long startNanos()Returns the value of thestartNanosrecord component.- Returns:
- the value of the
startNanosrecord component
-
stopMillis
public long stopMillis()Returns the value of thestopMillisrecord component.- Returns:
- the value of the
stopMillisrecord component
-
stopNanos
public long stopNanos()Returns the value of thestopNanosrecord component.- Returns:
- the value of the
stopNanosrecord component
-