@ThreadSafe @Immutable public final class DefaultAttributeConverterProvider extends Object implements AttributeConverterProvider
DefaultAttributeConverterProvider()
or the create()
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).
Modifier and Type | Class and Description |
---|---|
static class |
DefaultAttributeConverterProvider.Builder
A builder for configuring and creating
DefaultAttributeConverterProvider s. |
Constructor and Description |
---|
DefaultAttributeConverterProvider()
Returns an attribute converter provider with all default converters set.
|
Modifier and Type | Method and Description |
---|---|
static DefaultAttributeConverterProvider.Builder |
builder()
Equivalent to
builder(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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultProvider
public DefaultAttributeConverterProvider()
public static DefaultAttributeConverterProvider create()
public static DefaultAttributeConverterProvider.Builder builder()
builder(EnhancedType.of(Object.class))
.public <T> AttributeConverter<T> converterFor(EnhancedType<T> type)
converterFor
in interface AttributeConverterProvider
type
- The type of the object to be convertedAttributeConverter
for converting the given type.Copyright © 2023. All rights reserved.