Payload - The payload type.public abstract class AbstractSink<Payload> extends Object implements Sink<Payload>
AbstractSink is an abstract base implementation of a Sink.| Constructor and Description |
|---|
AbstractSink(Nullity nullity)
Creates a new
AbstractSink. |
| Modifier and Type | Method and Description |
|---|---|
Sink<Payload> |
add(Payload payload)
Adds the given payload value.
|
Sink<Payload> |
addAll(Iterable<? extends Payload> payloads)
Adds the given payload values.
|
Sink<Payload> |
addAll(Payload... payloads)
Adds the given payload values.
|
protected abstract void |
doAdd(Payload payload)
Adds the given payload value to this
Sink. |
boolean |
equals(Object object)
Compares the given object with this
Sink for equality, which must
not reveal any information about the payload values that have been added
so far. |
Nullity |
getNullity()
Returns the
Nullity this AbstractSink has been created
with. |
int |
hashCode()
Returns the hash code of this
Sink, which must not reveal any
information about the payload values that have been added so far. |
protected void |
onAdded(Payload payload)
Called after the given payload value has been added to this
Sink. |
String |
toString()
The String [].
|
public AbstractSink(Nullity nullity) throws IllegalArgumentException
AbstractSink.nullity - The intended Nullity of
added null
-valuesIllegalArgumentException - If the given Nullity is null.public final Nullity getNullity()
Nullity this AbstractSink has been created
with.Nullity.public final Sink<Payload> add(Payload payload) throws IllegalArgumentException, IllegalStateException
Sinkadd in interface Sink<Payload>payload - The payload value to be added.Sink.IllegalArgumentException - If the given payload value is null and this
Sink doesn't allow a null to be added.IllegalStateExceptionpublic final Sink<Payload> addAll(Payload... payloads) throws IllegalArgumentException, IllegalStateException
SinkaddAll in interface Sink<Payload>payloads - The array of payload values to be added.Sink.IllegalArgumentException - If the given array of payload values is null or if
any of the given payload values is null and this
Sink doesn't allow a null to be added.IllegalStateExceptionpublic final Sink<Payload> addAll(Iterable<? extends Payload> payloads) throws IllegalArgumentException, IllegalStateException
SinkaddAll in interface Sink<Payload>payloads - The Iterable of payload values to be added.Sink.IllegalArgumentException - If the given Iterable of payload values is
null or if any of the given payload values is
null and this Sink doesn't allow a
null to be added.IllegalStateExceptionprotected abstract void doAdd(Payload payload)
Sink.payload - The payload to be added, which is guaranteed to be not
null, unless the Nullity of this
Sink is Nullity.ALLOW.protected void onAdded(Payload payload)
Sink.payload - The added payload, which is guaranteed to be not
null , unless the Nullity of this
Sink is Nullity.ALLOW.public final int hashCode()
SinkSink, which must not reveal any
information about the payload values that have been added so far.public final boolean equals(Object object)
SinkSink for equality, which must
not reveal any information about the payload values that have been added
so far.Copyright © 2016–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.