Class ChainConverterProvider
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.internal.converter.ChainConverterProvider
-
- All Implemented Interfaces:
AttributeConverterProvider
public final class ChainConverterProvider extends Object implements AttributeConverterProvider
AAttributeConverterProvider
that allows multiple providers to be chained in a specified order to act as a single composite provider. When searching for an attribute converter for a type, the providers will be called in forward/ascending order, attempting to find a converter from the first provider, then the second, and so on, until a match is found or the operation fails.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AttributeConverterProvider>
chainedProviders()
<T> AttributeConverter<T>
converterFor(EnhancedType<T> enhancedType)
Finds aAttributeConverter
for converting an object with a type specified by aEnhancedType
to aAttributeValue
and back.static ChainConverterProvider
create(List<AttributeConverterProvider> providers)
Construct a new instance ofChainConverterProvider
.static ChainConverterProvider
create(AttributeConverterProvider... providers)
Construct a new instance ofChainConverterProvider
.boolean
equals(Object o)
int
hashCode()
-
-
-
Method Detail
-
create
public static ChainConverterProvider create(AttributeConverterProvider... providers)
Construct a new instance ofChainConverterProvider
.- Parameters:
providers
- A list ofAttributeConverterProvider
to chain together.- Returns:
- A constructed
ChainConverterProvider
object.
-
create
public static ChainConverterProvider create(List<AttributeConverterProvider> providers)
Construct a new instance ofChainConverterProvider
.- Parameters:
providers
- A list ofAttributeConverterProvider
to chain together.- Returns:
- A constructed
ChainConverterProvider
object.
-
chainedProviders
public List<AttributeConverterProvider> chainedProviders()
-
converterFor
public <T> AttributeConverter<T> converterFor(EnhancedType<T> enhancedType)
Description copied from interface:AttributeConverterProvider
Finds aAttributeConverter
for converting an object with a type specified by aEnhancedType
to aAttributeValue
and back.- Specified by:
converterFor
in interfaceAttributeConverterProvider
- Parameters:
enhancedType
- The type of the object to be converted- Returns:
AttributeConverter
for converting the given type.
-
-