Class DefaultAttributeConverterProvider
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider
-
- All Implemented Interfaces:
AttributeConverterProvider
@ThreadSafe @Immutable public final class DefaultAttributeConverterProvider extends Object implements AttributeConverterProvider
This class is the default attribute converter provider in the DDB Enhanced library. When instantiated using the constructorDefaultAttributeConverterProvider()
or thecreate()
method, it's loaded with the currently supported attribute converters in the library.Given an input, the method
converterFor(EnhancedType)
will identify a converter that can convert the specific Java type and invoke it. If a converter cannot be found, it will invoke a "parent" converter, which would be expected to be able to convert the value (or throw an exception).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultAttributeConverterProvider.Builder
A builder for configuring and creatingDefaultAttributeConverterProvider
s.
-
Constructor Summary
Constructors Constructor Description DefaultAttributeConverterProvider()
Returns an attribute converter provider with all default converters set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultAttributeConverterProvider.Builder
builder()
Equivalent tobuilder(EnhancedType.of(Object.class))
.<T> AttributeConverter<T>
converterFor(EnhancedType<T> type)
Find a converter that matches the provided type.static DefaultAttributeConverterProvider
create()
Returns an attribute converter provider with all default converters set.
-
-
-
Method Detail
-
create
public static DefaultAttributeConverterProvider create()
Returns an attribute converter provider with all default converters set.
-
builder
public static DefaultAttributeConverterProvider.Builder builder()
Equivalent tobuilder(EnhancedType.of(Object.class))
.
-
converterFor
public <T> AttributeConverter<T> converterFor(EnhancedType<T> type)
Find a converter that matches the provided type. If one cannot be found, throw an exception.- Specified by:
converterFor
in interfaceAttributeConverterProvider
- Parameters:
type
- The type of the object to be converted- Returns:
AttributeConverter
for converting the given type.
-
-