IK - the inner key type of the created transforming map, i.e. the type of the keys contained in the
wrapped/inner mapOK - the outer key type of the created transforming map, i.e. the type of keys appearing to be in this mapIV - the inner value type of the created transforming map, i.e. the type of the values contained in the
wrapped/inner mapOV - the outer value type of the created transforming map, i.e. the type of values appearing to be in this mappublic class TransformingMapBuilder<IK,OK,IV,OV> extends Object
TransformingMaps.
A builder can be obtained by calling forTypes or
forTypesUnknown(). The building method TODO can only be called after transformations from inner to outer
keys and values and vice versa have been set.
| Modifier and Type | Method and Description |
|---|---|
static <IK,OK,IV,OV> |
forTypes(Class<? super IK> innerKeyTypeToken,
Class<? super OK> outerKeyTypeToken,
Class<? super IV> innerValueTypeToken,
Class<? super OV> outerValueTypeToken)
Returns a new builder for the specified inner and outer key and value types.
|
static <IK,OK,IV,OV> |
forTypesUnknown()
Returns a new builder for unknown inner and outer key and value types.
|
TransformingMapBuilder<IK,OK,IV,OV> |
toInnerKey(Function<? super OK,? extends IK> transformToInnerKey)
Sets the transformation from outer to inner keys which will be used by the created map.
|
TransformingMapBuilder<IK,OK,IV,OV> |
toInnerValue(Function<? super OV,? extends IV> transformToInnerValue)
Sets the transformation from outer to inner values which will be used by the created map.
|
TransformingMapBuilder<IK,OK,IV,OV> |
toOuterKey(Function<? super IK,? extends OK> transformToOuterKey)
Sets the transformation from inner to outer keys which will be used by the created map.
|
TransformingMapBuilder<IK,OK,IV,OV> |
toOuterValue(Function<? super IV,? extends OV> transformToOuterValue)
Sets the transformation from inner to outer values which will be used by the created map.
|
TransformingMap<IK,OK,IV,OV> |
transformMap(Map<IK,IV> map)
Creates a
TransformingMap which transforms/decorates the specified map. |
public static <IK,OK,IV,OV> TransformingMapBuilder<IK,OK,IV,OV> forTypes(Class<? super IK> innerKeyTypeToken, Class<? super OK> outerKeyTypeToken, Class<? super IV> innerValueTypeToken, Class<? super OV> outerValueTypeToken)
IK - the inner key type of the created transforming map, i.e. the type of the keys contained in the
wrapped/inner mapOK - the outer key type of the created transforming map, i.e. the type of keys appearing to be in this mapIV - the inner value type of the created transforming map, i.e. the type of the values contained in the
wrapped/inner mapOV - the outer value type of the created transforming map, i.e. the type of values appearing to be in this
mapinnerKeyTypeToken - the token for the inner key typeouterKeyTypeToken - the token for the outer key typeinnerValueTypeToken - the token for the inner value typeouterValueTypeToken - the token for the outer value typepublic static <IK,OK,IV,OV> TransformingMapBuilder<IK,OK,IV,OV> forTypesUnknown()
This is equivalent to calling forTypes(Object.class, Object.class,
Object.class, Object.class). To obtain a builder for <IK, OK, IV, OV> you will have to call
TransformingMapBuilder.<IK, OK, IV, OV> forTypesUnknown().
IK - the inner key type of the created transforming map, i.e. the type of the keys contained in the
wrapped/inner mapOK - the outer key type of the created transforming map, i.e. the type of keys appearing to be in this mapIV - the inner value type of the created transforming map, i.e. the type of the values contained in the
wrapped/inner mapOV - the outer value type of the created transforming map, i.e. the type of values appearing to be in this
mappublic TransformingMapBuilder<IK,OK,IV,OV> toOuterKey(Function<? super IK,? extends OK> transformToOuterKey)
transformToOuterKey - transforms inner to outer keyspublic TransformingMapBuilder<IK,OK,IV,OV> toInnerKey(Function<? super OK,? extends IK> transformToInnerKey)
transformToInnerKey - transforms outer to inner keyspublic TransformingMapBuilder<IK,OK,IV,OV> toOuterValue(Function<? super IV,? extends OV> transformToOuterValue)
transformToOuterValue - transforms inner to outer valuespublic TransformingMapBuilder<IK,OK,IV,OV> toInnerValue(Function<? super OV,? extends IV> transformToInnerValue)
transformToInnerValue - transforms outer to inner valuespublic TransformingMap<IK,OK,IV,OV> transformMap(Map<IK,IV> map)
TransformingMap which transforms/decorates the specified map.map - the map to transform; will be the inner map of the returned transformationTransformingMapThis documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.