Package com.rosetta.model.lib.mapper
Class MapperS<T>
java.lang.Object
com.rosetta.model.lib.mapper.MapperS<T>
- All Implemented Interfaces:
Mapper<T>,MapperBuilder<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.rosetta.model.lib.mapper.Mapper
Mapper.Path -
Constructor Summary
ConstructorsConstructorDescriptionMapperS(MapperItem<? extends T, ?> item) MapperS(MapperItem<? extends T, ?> item, boolean identity) -
Method Summary
Modifier and TypeMethodDescription<F> FApply a function to this mapper<F> MapperS<F> checkedMap(NamedFunction<T, F> mappingFunc, Class<? extends Exception> errorClass) <F> MapperS<F> booleanfilterSingle(Predicate<MapperS<T>> predicate) filterSingleNullSafe(Function<MapperS<T>, Boolean> predicate) get()Stream<MapperItem<? extends T, ?>> getItems()getMulti()getOrDefault(T defaultValue) Optional<?> List<?> getPaths()inthashCode()static <T> MapperS<T> identity()boolean<F> MapperS<F> map(NamedFunction<T, F> mappingFunc) Maps single parent item to single child item.<F> MapperS<F> Helper function to map a value with single cardinality<F> MapperC<F> mapC(NamedFunction<T, List<? extends F>> mappingFunc) Maps single parent item to list child item.<F> MapperC<F> Helper function to map a value with multiple cardinality<F> MapperS<F> mapSingleToItem(Function<MapperS<T>, MapperS<F>> mappingFunc) Map a single value to a single value.<F> MapperC<F> mapSingleToList(Function<MapperS<T>, MapperC<F>> mappingFunc) Map a single value into an item of a list based on the given mapping function.static <T> MapperS<T> of(T t) static <T,P> MapperS <T> of(T t, com.rosetta.model.lib.mapper.MapperPath path, MapperItem<P, ?> parent) static <T> MapperS<T> ofNull()inttoString()unionDifferent(MapperBuilder<?> other) unionSame(MapperBuilder<T> other) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.rosetta.model.lib.mapper.MapperBuilder
convert, findParent
-
Constructor Details
-
MapperS
-
MapperS
-
-
Method Details
-
identity
-
ofNull
-
of
-
of
public static <T,P> MapperS<T> of(T t, com.rosetta.model.lib.mapper.MapperPath path, MapperItem<P, ?> parent) -
filterSingle
-
filterSingleNullSafe
-
map
Description copied from interface:MapperBuilderHelper function to map a value with single cardinality- Specified by:
mapin interfaceMapperBuilder<T>
-
map
Maps single parent item to single child item.- Specified by:
mapin interfaceMapperBuilder<T>
-
checkedMap
-
checkedMap
public <F> MapperS<F> checkedMap(NamedFunction<T, F> mappingFunc, Class<? extends Exception> errorClass) -
mapC
Description copied from interface:MapperBuilderHelper function to map a value with multiple cardinality- Specified by:
mapCin interfaceMapperBuilder<T>
-
mapC
Maps single parent item to list child item.- Specified by:
mapCin interfaceMapperBuilder<T>
-
get
-
getOrDefault
- Specified by:
getOrDefaultin interfaceMapper<T>
-
getMulti
-
getParent
-
getParentMulti
- Specified by:
getParentMultiin interfaceMapper<T>
-
resultCount
public int resultCount()- Specified by:
resultCountin interfaceMapper<T>
-
isIdentity
public boolean isIdentity() -
mapSingleToItem
Map a single value to a single value.- Type Parameters:
F-- Parameters:
mappingFunc-- Returns:
- mapped list
-
mapSingleToList
Map a single value into an item of a list based on the given mapping function.- Type Parameters:
F-- Parameters:
mappingFunc-- Returns:
- mapped list
-
apply
Apply a function to this mapper -
getPaths
-
getErrorPaths
- Specified by:
getErrorPathsin interfaceMapper<T>
-
getErrors
-
toString
-
unionSame
- Specified by:
unionSamein interfaceMapperBuilder<T>
-
unionDifferent
- Specified by:
unionDifferentin interfaceMapperBuilder<T>
-
hashCode
public int hashCode() -
equals
-
getItems
- Specified by:
getItemsin interfaceMapperBuilder<T>
-