Record Class WaitForLogOptions
java.lang.Object
java.lang.Record
codes.grow.packages.betterstack.logging.WaitForLogOptions
- Record Components:
timeout- overall wait (default 30 s)interval- delay between searches (default 1 s)predicate- extra filter on the found records (default: any record)search- options of each search (defaultSearchOptions.defaults())
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWaitForLogOptions(Duration timeout, Duration interval, Predicate<LogRecord> predicate, SearchOptions search) Fills defaults fornullvalues. -
Method Summary
Modifier and TypeMethodDescriptionstatic WaitForLogOptionsdefaults()Defaults: 30 s timeout, 1 s interval, any record.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.static WaitForLogOptionsOptions with a timeout and interval.Returns the value of thepredicaterecord component.search()Returns the value of thesearchrecord component.timeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.withPredicate(Predicate<LogRecord> filter) Copy with a predicate.
-
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
-
WaitForLogOptions
public WaitForLogOptions(Duration timeout, Duration interval, Predicate<LogRecord> predicate, SearchOptions search) Fills defaults fornullvalues.- Parameters:
timeout- overall waitinterval- delay between searchespredicate- record filtersearch- search options
-
-
Method Details
-
defaults
Defaults: 30 s timeout, 1 s interval, any record.- Returns:
- defaults
-
of
Options with a timeout and interval.- Parameters:
timeout- overall waitinterval- delay between searches- Returns:
- options
-
withPredicate
Copy with a predicate.- Parameters:
filter- record filter- 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). -
timeout
Returns the value of thetimeoutrecord component.- Returns:
- the value of the
timeoutrecord component
-
interval
Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
search
Returns the value of thesearchrecord component.- Returns:
- the value of the
searchrecord component
-