Package codes.grow.packages.loki
Record Class TimeRange
java.lang.Object
java.lang.Record
codes.grow.packages.loki.TimeRange
- Record Components:
start- inclusive start, or empty (server default: one hour before end)end- end, or empty (now)
A time window for
LokiClient.series(java.util.List<java.lang.String>), LokiClient.indexStats(java.lang.String) and the label calls.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TimeRangedefaults()The server's default window.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static TimeRangeThe lastwindowup to now.static TimeRangeA window fromstarttoend.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TimeRange
Normalizesnullfields to empty.- Parameters:
start- startend- end
-
-
Method Details
-
defaults
The server's default window.- Returns:
- an empty range
-
of
A window fromstarttoend.- Parameters:
start- start ornullend- end ornull- Returns:
- the range
-
last
The lastwindowup to now.- Parameters:
window- positive duration- Returns:
- the range
-
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). -
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-