Class ExecutionAttributes
- java.lang.Object
-
- software.amazon.awssdk.core.interceptor.ExecutionAttributes
-
- All Implemented Interfaces:
ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
@NotThreadSafe public class ExecutionAttributes extends Object implements ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
A mutable collection ofExecutionAttribute
s that can be modified byExecutionInterceptor
s in order to save and retrieve information specific to the current execution. This is useful for sharing data betweenExecutionInterceptor
method calls specific to a particular execution.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExecutionAttributes.Builder
TODO: We should deprecate this builder - execution attributes are mutable - why do we need a builder? We can just use copy() if it's because ofunmodifiableExecutionAttributes(ExecutionAttributes)
.
-
Constructor Summary
Constructors Modifier Constructor Description ExecutionAttributes()
protected
ExecutionAttributes(Map<? extends ExecutionAttribute<?>,?> attributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Constructor Detail
-
ExecutionAttributes
public ExecutionAttributes()
-
ExecutionAttributes
protected ExecutionAttributes(Map<? extends ExecutionAttribute<?>,?> attributes)
-
-
Method Detail
-
getAttribute
public <U> U getAttribute(ExecutionAttribute<U> attribute)
Retrieve the current value of the provided attribute in this collection of attributes. This will return null if the value is not set.
-
getAttributes
public Map<ExecutionAttribute<?>,Object> getAttributes()
Retrieve the collection of attributes.
-
getOptionalAttribute
public <U> Optional<U> getOptionalAttribute(ExecutionAttribute<U> attribute)
Retrieve the Optional current value of the provided attribute in this collection of attributes. This will return Optional Value.
-
putAttribute
public <U> ExecutionAttributes putAttribute(ExecutionAttribute<U> attribute, U value)
Update or set the provided attribute in this collection of attributes.
-
putAttributeIfAbsent
public <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.
-
merge
public ExecutionAttributes merge(ExecutionAttributes lowerPrecedenceExecutionAttributes)
Merge attributes of a higher precedence into the current lower precedence collection.
-
putAbsentAttributes
public void putAbsentAttributes(ExecutionAttributes lowerPrecedenceExecutionAttributes)
Add the provided attributes to this attribute, if the provided attribute does not exist.
-
builder
public static ExecutionAttributes.Builder builder()
-
toBuilder
public ExecutionAttributes.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
-
copy
public ExecutionAttributes copy()
-
unmodifiableExecutionAttributes
public static ExecutionAttributes unmodifiableExecutionAttributes(ExecutionAttributes attributes)
-
-