java.lang.Object
java.lang.Record
org.bsc.async.AsyncGenerator.Data<E>
- Type Parameters:
E- the type of the data element
- Enclosing interface:
- AsyncGenerator<E>
public static record AsyncGenerator.Data<E>(CompletableFuture<E> future, AsyncGenerator.Embed<E> embed, Object resultValue)
extends Record
Represents a data element in the AsyncGenerator.
-
Constructor Summary
ConstructorsConstructorDescriptionData(CompletableFuture<E> future, AsyncGenerator.Embed<E> embed, Object resultValue) Creates an instance of aDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> AsyncGenerator.Data<E>composeWith(AsyncGenerator<E> generator, AsyncGenerator.EmbedCompletionHandler onCompletion) static <E> AsyncGenerator.Data<E>done()static <E> AsyncGenerator.Data<E>embed()Returns the value of theembedrecord component.final booleanIndicates whether some other object is "equal to" this one.static <E> AsyncGenerator.Data<E>future()Returns the value of thefuturerecord component.final inthashCode()Returns a hash code value for this object.booleanisDone()booleanisError()static <E> AsyncGenerator.Data<E>of(E data) static <E> AsyncGenerator.Data<E>of(CompletableFuture<E> future) Returns the value of theresultValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Data
Creates an instance of aDatarecord class.- Parameters:
future- the value for thefuturerecord componentembed- the value for theembedrecord componentresultValue- the value for theresultValuerecord component
-
-
Method Details
-
isDone
public boolean isDone() -
isError
public boolean isError() -
of
-
of
-
composeWith
public static <E> AsyncGenerator.Data<E> composeWith(AsyncGenerator<E> generator, AsyncGenerator.EmbedCompletionHandler onCompletion) -
done
-
done
-
error
-
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). -
future
Returns the value of thefuturerecord component.- Returns:
- the value of the
futurerecord component
-
embed
Returns the value of theembedrecord component.- Returns:
- the value of the
embedrecord component
-
resultValue
Returns the value of theresultValuerecord component.- Returns:
- the value of the
resultValuerecord component
-