Record Class TailOptions
java.lang.Object
java.lang.Record
codes.grow.packages.betterstack.logging.TailOptions
- Record Components:
start- first record time (empty = now)interval- polling interval for services that poll (default 1 s)onError- receives errors; tailing continues
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TailOptionsdefaults()Defaults: from now, 1 s interval, errors ignored.final booleanIndicates whether some other object is "equal to" this one.Returns the interval the caller set, or empty when it was left unset (the record then holdsDEFAULT_INTERVAL).final inthashCode()Returns a hash code value for this object.interval()Returns the value of theintervalrecord component.intervalOr(Duration serviceDefault) Returns the caller's interval, orserviceDefaultwhen it was left unset.onError()Returns the value of theonErrorrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.withOnError(Consumer<Throwable> callback) Copy with an error callback.
-
Field Details
-
DEFAULT_INTERVAL
The interval used when none is given.explicitInterval()tells this default apart from an interval the caller chose, so a service can apply its own default (passing this constant itself counts as unset).
-
-
Constructor Details
-
TailOptions
Fills defaults fornullvalues.- Parameters:
start- first record timeinterval- polling intervalonError- error callback
-
-
Method Details
-
defaults
Defaults: from now, 1 s interval, errors ignored.- Returns:
- defaults
-
withOnError
Copy with an error callback.- Parameters:
callback- error callback- Returns:
- options
-
explicitInterval
Returns the interval the caller set, or empty when it was left unset (the record then holdsDEFAULT_INTERVAL).- Returns:
- the explicit interval, if any
-
intervalOr
Returns the caller's interval, orserviceDefaultwhen it was left unset.- Parameters:
serviceDefault- the service's own default interval- Returns:
- the interval to use
-
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
-
interval
Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
onError
Returns the value of theonErrorrecord component.- Returns:
- the value of the
onErrorrecord component
-