Top Fields Constructors Methods
reactor.util.context

pack-priv final Class Context2

extends Object
implements CoreContext
Class Inheritance
All Implemented Interfaces
reactor.util.context.CoreContext, reactor.util.context.Context, reactor.util.context.ContextView
Imports
java.util.AbstractMap, .Map, .NoSuchElementException, .Objects, java.util.function.BiConsumer, java.util.stream.Stream

Field Summary

Modifier and TypeField and Description
pack-priv final Object
pack-priv final Object
pack-priv final Object
pack-priv final Object

Constructor Summary

AccessConstructor and Description
pack-priv
Context2(Object key1, Object value1, Object key2, Object value2)

Method Summary

Modifier and TypeMethod and Description
public Context
delete(Object
the key to remove.
key
)

Implements reactor.util.context.Context.delete.

Return a new Context that will resolve all existing keys except the removed one, key.
public void
forEach(BiConsumer<Object, Object>
The action to be performed for each entry
action
)

Overrides default reactor.util.context.ContextView.forEach.

Perform the given action for each entry in this ContextView.
public <T> T
get(Object
a lookup key to resolve the value within the context
key
)

Implements reactor.util.context.ContextView.get.

Resolve a value given a key that exists within the Context, or throw a NoSuchElementException if the key is not present.
public boolean
hasKey(Object
a lookup key to test for
key
)

Implements reactor.util.context.ContextView.hasKey.

Return true if a particular key resolves to a value within the Context.
public Context
put(Object
the key to add/update in the new Context
key
,
Object
the value to associate to the key in the new Context
value
)

Implements reactor.util.context.Context.put.

Create a new Context that contains all current key/value pairs plus the given key/value pair.
public Context
putAllInto(Context
the Context in which we're putting all our values
base
)

Implements reactor.util.context.CoreContext.putAllInto.

Let this Context add its internal values to the given base Context, avoiding creating intermediate holders for key-value pairs as much as possible.
public int
size()

Implements reactor.util.context.ContextView.size.

Return the size of this Context, the number of immutable key/value pairs stored inside it.
public Stream<Map.Entry<Object, Object>>
stream()

Implements reactor.util.context.ContextView.stream.

Stream key/value pairs from this Context
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
unsafePutAllInto(ContextN
the ContextN we're mutating by putting all our values into
other
)

Implements reactor.util.context.CoreContext.unsafePutAllInto.

Let this Context add its internal values to the given ContextN, mutating it, but avoiding creating intermediate holders for key-value pairs as much as possible.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

key1back to summary
pack-priv final Object key1
key2back to summary
pack-priv final Object key2
value1back to summary
pack-priv final Object value1
value2back to summary
pack-priv final Object value2

Constructor Detail

Context2back to summary
pack-priv Context2(Object key1, Object value1, Object key2, Object value2)

Method Detail

deleteback to summary
public Context delete(Object key)

Implements reactor.util.context.Context.delete.

Doc from reactor.util.context.Context.delete.

Return a new Context that will resolve all existing keys except the removed one, key.

Note that if this Context doesn't contain the key, this method simply returns this same instance.

Parameters
key:Object

the key to remove.

Returns:Context

a new Context that doesn't include the provided key

Annotations
@Override
forEachback to summary
public void forEach(BiConsumer<Object, Object> action)

Overrides default reactor.util.context.ContextView.forEach.

Doc from reactor.util.context.ContextView.forEach.

Perform the given action for each entry in this ContextView. If the action throws an exception, it is immediately propagated to the caller and the remaining items will not be processed.

Parameters
action:BiConsumer<Object, Object>

The action to be performed for each entry

Annotations
@Override
getback to summary
public <T> T get(Object key)

Implements reactor.util.context.ContextView.get.

Doc from reactor.util.context.ContextView.get.

Resolve a value given a key that exists within the Context, or throw a NoSuchElementException if the key is not present.

Parameters
<T>
an unchecked casted generic for fluent typing convenience
key:Object

a lookup key to resolve the value within the context

Returns:T

the value resolved for this key (throws if key not found)

Annotations
@Override
@SuppressWarnings:unchecked
hasKeyback to summary
public boolean hasKey(Object key)

Implements reactor.util.context.ContextView.hasKey.

Doc from reactor.util.context.ContextView.hasKey.

Return true if a particular key resolves to a value within the Context.

Parameters
key:Object

a lookup key to test for

Returns:boolean

true if this context contains the given key

Annotations
@Override
putback to summary
public Context put(Object key, Object value)

Implements reactor.util.context.Context.put.

Doc from reactor.util.context.Context.put.

Create a new Context that contains all current key/value pairs plus the given key/value pair. If that key existed in the current Context, its associated value is replaced in the resulting Context.

Parameters
key:Object

the key to add/update in the new Context

value:Object

the value to associate to the key in the new Context

Returns:Context

a new Context including the provided key/value

Annotations
@Override
putAllIntoback to summary
public Context putAllInto(Context base)

Implements reactor.util.context.CoreContext.putAllInto.

Doc from reactor.util.context.CoreContext.putAllInto.

Let this Context add its internal values to the given base Context, avoiding creating intermediate holders for key-value pairs as much as possible.

Parameters
base:Context

the Context in which we're putting all our values

Returns:Context

a new context containing all the base values merged with all our values

Annotations
@Override
sizeback to summary
public int size()

Implements reactor.util.context.ContextView.size.

Doc from reactor.util.context.ContextView.size.

Return the size of this Context, the number of immutable key/value pairs stored inside it.

Returns:int

the size of the Context

Annotations
@Override
streamback to summary
public Stream<Map.Entry<Object, Object>> stream()

Implements reactor.util.context.ContextView.stream.

Doc from reactor.util.context.ContextView.stream.

Stream key/value pairs from this Context

Returns:Stream<Map.Entry<Object, Object>>

a Stream of key/value pairs held by this context

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
unsafePutAllIntoback to summary
public void unsafePutAllInto(ContextN other)

Implements reactor.util.context.CoreContext.unsafePutAllInto.

Doc from reactor.util.context.CoreContext.unsafePutAllInto.

Let this Context add its internal values to the given ContextN, mutating it, but avoiding creating intermediate holders for key-value pairs as much as possible.

Parameters
other:ContextN

the ContextN we're mutating by putting all our values into

Annotations
@Override