M
- the type of the multi-valued reference after mapping@ParametersAreNonnullByDefault public interface ManyReferenceMergedAs<M> extends ValueMapper, ManyReferenceMapper
ManyReferenceMapper
that provides a default behavior to use M
instead of a set of Id
for
multi-valued references.
This mapper merges the multi-valued references into a single value.
Modifier and Type | Method and Description |
---|---|
default void |
addAllReferences(ManyFeatureBean feature,
List<Id> collection)
Adds all the
collection to the specified feature from the position of the feature . |
default void |
addReference(ManyFeatureBean feature,
Id reference)
Adds the
reference to the specified feature at a defined position. |
default Stream<Id> |
allReferencesOf(SingleFeatureBean feature)
Retrieves all references of the specified
feature . |
Converter<List<Id>,M> |
manyReferenceMerger()
Returns the converter used to transform a ordered list of references to the desired type.
|
default Optional<Id> |
referenceFor(ManyFeatureBean feature,
Id reference)
Defines the
reference of the specified feature at a defined position. |
default Optional<Id> |
referenceOf(ManyFeatureBean feature)
Retrieves the reference of the specified
feature at a defined position. |
default void |
removeAllReferences(SingleFeatureBean feature)
Removes all references of the specified
feature . |
default Optional<Id> |
removeReference(ManyFeatureBean feature)
Removes the reference of the specified
feature at a defined position. |
default Optional<Integer> |
sizeOfReference(SingleFeatureBean feature)
Returns the number of reference of the specified
feature . |
removeValue, valueFor, valueOf
appendAllReferences, appendReference
referenceFor, referenceOf, removeReference
@Nonnull default Optional<Id> referenceOf(ManyFeatureBean feature)
ManyReferenceMapper
feature
at a defined position.referenceOf
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued referenceOptional
containing the reference, or Optional.empty()
if the feature hasn't any
reference or doesn't exist@Nonnull default Stream<Id> allReferencesOf(SingleFeatureBean feature)
ManyReferenceMapper
feature
.allReferencesOf
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued referenceStream
over all references@Nonnull default Optional<Id> referenceFor(ManyFeatureBean feature, Id reference)
ManyReferenceMapper
reference
of the specified feature
at a defined position.referenceFor
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued referencereference
- the reference to setOptional
containing the previous reference of the feature
, or Optional.empty()
if the feature has no reference beforeManyReferenceMapper.addReference(ManyFeatureBean, Id)
,
ManyReferenceMapper.appendReference(SingleFeatureBean, Id)
default void addReference(ManyFeatureBean feature, Id reference)
ManyReferenceMapper
reference
to the specified feature
at a defined position.addReference
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued referencereference
- the reference to adddefault void addAllReferences(ManyFeatureBean feature, List<Id> collection)
ManyReferenceMapper
collection
to the specified feature
from the position of the feature
.addAllReferences
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued attributecollection
- the values to add@Nonnull default Optional<Id> removeReference(ManyFeatureBean feature)
ManyReferenceMapper
feature
at a defined position.removeReference
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued referenceOptional
containing the removed reference, or Optional.empty()
if the feature has no
reference beforedefault void removeAllReferences(SingleFeatureBean feature)
ManyReferenceMapper
feature
.removeAllReferences
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued reference@Nonnull @Nonnegative default Optional<Integer> sizeOfReference(SingleFeatureBean feature)
ManyReferenceMapper
feature
.sizeOfReference
in interface ManyReferenceMapper
feature
- the bean identifying the multi-valued referenceOptional
containing the number of reference of the feature
, or Optional.empty()
if the feature
hasn't any referenceCopyright © 2013–2019 Atlanmod. All rights reserved.