Class ExecutionAttributes
- java.lang.Object
-
- software.amazon.awssdk.core.interceptor.ExecutionAttributes
-
- All Implemented Interfaces:
software.amazon.awssdk.utils.builder.ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
@NotThreadSafe public class ExecutionAttributes extends Object implements software.amazon.awssdk.utils.builder.ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
A mutable collection ofExecutionAttributes that can be modified byExecutionInterceptors in order to save and retrieve information specific to the current execution. This is useful for sharing data betweenExecutionInterceptormethod calls specific to a particular execution.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExecutionAttributes.BuilderTODO: 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()protectedExecutionAttributes(Map<? extends ExecutionAttribute<?>,?> attributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExecutionAttributes.Builderbuilder()ExecutionAttributescopy()booleanequals(Object o)<U> UgetAttribute(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.inthashCode()ExecutionAttributesmerge(ExecutionAttributes lowerPrecedenceExecutionAttributes)Merge attributes of a higher precedence into the current lower precedence collection.voidputAbsentAttributes(ExecutionAttributes lowerPrecedenceExecutionAttributes)Add the provided attributes to this attribute, if the provided attribute does not exist.<U> ExecutionAttributesputAttribute(ExecutionAttribute<U> attribute, U value)Update or set the provided attribute in this collection of attributes.<U> ExecutionAttributesputAttributeIfAbsent(ExecutionAttribute<U> attribute, U value)Set the provided attribute in this collection of attributes if it does not already exist in the collection.ExecutionAttributes.BuildertoBuilder()StringtoString()static ExecutionAttributesunmodifiableExecutionAttributes(ExecutionAttributes attributes)
-
-
-
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:
toBuilderin interfacesoftware.amazon.awssdk.utils.builder.ToCopyableBuilder<ExecutionAttributes.Builder,ExecutionAttributes>
-
copy
public ExecutionAttributes copy()
-
unmodifiableExecutionAttributes
public static ExecutionAttributes unmodifiableExecutionAttributes(ExecutionAttributes attributes)
-
-