@NotThreadSafe public class ExecutionAttributes extends Object implements ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
ExecutionAttribute
s that can be modified by ExecutionInterceptor
s in order to save and
retrieve information specific to the current execution.
This is useful for sharing data between ExecutionInterceptor
method calls specific to a particular execution.Modifier and Type | Class and Description |
---|---|
static class |
ExecutionAttributes.Builder |
Modifier | Constructor and Description |
---|---|
|
ExecutionAttributes() |
protected |
ExecutionAttributes(Map<? extends ExecutionAttribute<?>,?> attributes) |
Modifier and Type | Method and Description |
---|---|
static ExecutionAttributes.Builder |
builder() |
ExecutionAttributes |
copy() |
boolean |
equals(Object o) |
<U> U |
getAttribute(ExecutionAttribute<U> attribute)
Retrieve the current value of the provided attribute in this collection of attributes.
|
Map<ExecutionAttribute<?>,Object> |
getAttributes()
Retrieve the collection of attributes.
|
<U> Optional<U> |
getOptionalAttribute(ExecutionAttribute<U> attribute)
Retrieve the Optional current value of the provided attribute in this collection of attributes.
|
int |
hashCode() |
ExecutionAttributes |
merge(ExecutionAttributes lowerPrecedenceExecutionAttributes)
Merge attributes of a higher precedence into the current lower precedence collection.
|
void |
putAbsentAttributes(ExecutionAttributes lowerPrecedenceExecutionAttributes)
Add the provided attributes to this attribute, if the provided attribute does not exist.
|
<U> ExecutionAttributes |
putAttribute(ExecutionAttribute<U> attribute,
U value)
Update or set the provided attribute in this collection of attributes.
|
<U> ExecutionAttributes |
putAttributeIfAbsent(ExecutionAttribute<U> attribute,
U value)
Set the provided attribute in this collection of attributes if it does not already exist in the collection.
|
ExecutionAttributes.Builder |
toBuilder() |
String |
toString() |
static ExecutionAttributes |
unmodifiableExecutionAttributes(ExecutionAttributes attributes) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copy
public ExecutionAttributes()
protected ExecutionAttributes(Map<? extends ExecutionAttribute<?>,?> attributes)
public <U> U getAttribute(ExecutionAttribute<U> attribute)
public Map<ExecutionAttribute<?>,Object> getAttributes()
public <U> Optional<U> getOptionalAttribute(ExecutionAttribute<U> attribute)
public <U> ExecutionAttributes putAttribute(ExecutionAttribute<U> attribute, U value)
public ExecutionAttributes merge(ExecutionAttributes lowerPrecedenceExecutionAttributes)
public void putAbsentAttributes(ExecutionAttributes lowerPrecedenceExecutionAttributes)
public <U> ExecutionAttributes putAttributeIfAbsent(ExecutionAttribute<U> attribute, U value)
public static ExecutionAttributes.Builder builder()
public ExecutionAttributes.Builder toBuilder()
toBuilder
in interface ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
public ExecutionAttributes copy()
public static ExecutionAttributes unmodifiableExecutionAttributes(ExecutionAttributes attributes)
Copyright © 2022. All rights reserved.