Class StreamTermination
java.lang.Object
com.soklet.StreamTermination
Immutable details describing why and when a stream terminated.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder used to construct instances ofStreamTermination.static final classMutable copier seeded with an existingStreamTermination. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Vends a mutable copier seeded with this instance's data, suitable for building new instances.booleangetCause()The underlying termination cause, if available.How long the stream existed.Why the stream terminated.inthashCode()toString()with(@NonNull StreamTerminationReason reason, @NonNull Duration duration) Acquires a builder forStreamTerminationinstances.
-
Method Details
-
with
public static @NonNull StreamTermination.Builder with(@NonNull StreamTerminationReason reason, @NonNull Duration duration) Acquires a builder forStreamTerminationinstances.- Parameters:
reason- why the stream terminatedduration- how long the stream existed- Returns:
- the builder
-
toString
-
equals
-
hashCode
-
getReason
Why the stream terminated.- Returns:
- the termination reason
-
getDuration
-
getCause
The underlying termination cause, if available.- Returns:
- the underlying cause, or
Optional.empty()if unavailable
-
copy
Vends a mutable copier seeded with this instance's data, suitable for building new instances.- Returns:
- a copier for this instance
-