public interface ConverterBuilder
GenericConverter
instances using Java 8 lambdas, mostly in bidirectional fashion for
easy registration as custom type converters of the Spring Data mapping subsystem. The registration starts either with
the definition of a reading or writing converter that can then be completed.reading(Class, Class, Function)
,
writing(Class, Class, Function)
Modifier and Type | Interface and Description |
---|---|
static interface |
ConverterBuilder.ConverterAware
A
ConverterBuilder aware of both a reading and writing converter. |
static interface |
ConverterBuilder.ReadingConverterAware
Exposes a reading converter.
|
static interface |
ConverterBuilder.ReadingConverterBuilder<T,S>
Interface to represent an intermediate setup step of
ConverterBuilder.ConverterAware defining a reading converter first. |
static interface |
ConverterBuilder.WritingConverterAware
Exposes a writing converter.
|
static interface |
ConverterBuilder.WritingConverterBuilder<S,T>
Interface to represent an intermediate setup step of
ConverterBuilder.ConverterAware defining a writing converter first. |
Modifier and Type | Method and Description |
---|---|
Set<GenericConverter> |
getConverters()
Returns all
GenericConverter instances to be registered for the current ConverterBuilder . |
static <S,T> ConverterBuilder.ReadingConverterBuilder<S,T> |
reading(Class<S> source,
Class<T> target,
Function<? super S,? extends T> function)
Creates a new
ConverterBuilder.ReadingConverterBuilder to produce a converter to read values of the given source (the store
type) into the given target (the domain type). |
static <S,T> ConverterBuilder.WritingConverterBuilder<S,T> |
writing(Class<S> source,
Class<T> target,
Function<? super S,? extends T> function)
Creates a new
ConverterBuilder.WritingConverterBuilder to produce a converter to write values of the given source (the
domain type) into the given target (the store type). |
static <S,T> ConverterBuilder.ReadingConverterBuilder<S,T> reading(Class<S> source, Class<T> target, Function<? super S,? extends T> function)
ConverterBuilder.ReadingConverterBuilder
to produce a converter to read values of the given source (the store
type) into the given target (the domain type).source
- must not be null.target
- must not be null.function
- must not be null.static <S,T> ConverterBuilder.WritingConverterBuilder<S,T> writing(Class<S> source, Class<T> target, Function<? super S,? extends T> function)
ConverterBuilder.WritingConverterBuilder
to produce a converter to write values of the given source (the
domain type) into the given target (the store type).source
- must not be null.target
- must not be null.function
- must not be null.Set<GenericConverter> getConverters()
GenericConverter
instances to be registered for the current ConverterBuilder
.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.