Package io.github.pellse.assembler
Record Class RuleMapperContext.OneToManyContext<T,TC extends Collection<T>,K,ID,EID,R,RC extends Collection<R>>
java.lang.Object
java.lang.Record
io.github.pellse.assembler.RuleMapperContext.OneToManyContext<T,TC,K,ID,EID,R,RC>
- All Implemented Interfaces:
RuleContext<T,,TC, K, ID, R, RC> RuleMapperContext<T,TC, K, ID, EID, R, RC>
- Enclosing interface:
RuleMapperContext<T,TC extends Collection<T>, K, ID, EID, R, RRC>
public static record RuleMapperContext.OneToManyContext<T,TC extends Collection<T>,K,ID,EID,R,RC extends Collection<R>> (Function<T,K> topLevelIdResolver, Function<R,ID> innerIdResolver, Function<T,ID> outerIdResolver, Supplier<TC extends Collection<T>> topLevelCollectionFactory, MapFactory<ID,RC extends Collection<R>> mapFactory, Function<R,EID> idResolver, Comparator<R> idComparator, Supplier<RC extends Collection<R>> collectionFactory, Class<RC extends Collection<R>> collectionType)
extends Record
implements RuleMapperContext<T,TC,K,ID,EID,R,RC>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.pellse.assembler.RuleContext
RuleContext.DefaultRuleContext<T,TC extends Collection<T>, K, ID, R, RRC> Nested classes/interfaces inherited from interface io.github.pellse.assembler.RuleMapperContext
RuleMapperContext.OneToManyContext<T,TC extends Collection<T>, K, ID, EID, R, RC extends Collection<R>>, RuleMapperContext.OneToOneContext<T, TC extends Collection<T>, K, ID, R> -
Constructor Summary
ConstructorsConstructorDescriptionOneToManyContext(RuleContext<T, TC, K, ID, R, RC> ruleContext, Function<R, EID> idResolver, Comparator<R> idComparator, Supplier<RC> collectionFactory) OneToManyContext(Function<T, K> topLevelIdResolver, Function<R, ID> innerIdResolver, Function<T, ID> outerIdResolver, Supplier<TC> topLevelCollectionFactory, MapFactory<ID, RC> mapFactory, Function<R, EID> idResolver, Comparator<R> idComparator, Supplier<RC> collectionFactory, Class<RC> collectionType) Creates an instance of aOneToManyContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecollectionFactoryrecord component.Returns the value of thecollectionTyperecord component.convert(Collection<R> collection) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theidComparatorrecord component.Returns the value of theidResolverrecord component.Returns the value of theinnerIdResolverrecord component.Returns the value of themapFactoryrecord component.Returns the value of theouterIdResolverrecord component.Returns the value of thetopLevelCollectionFactoryrecord component.Returns the value of thetopLevelIdResolverrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OneToManyContext
-
OneToManyContext
public OneToManyContext(Function<T, K> topLevelIdResolver, Function<R, ID> innerIdResolver, Function<T, ID> outerIdResolver, Supplier<TC> topLevelCollectionFactory, MapFactory<ID, RC> mapFactory, Function<R, EID> idResolver, Comparator<R> idComparator, Supplier<RC> collectionFactory, Class<RC> collectionType) Creates an instance of aOneToManyContextrecord class.- Parameters:
topLevelIdResolver- the value for thetopLevelIdResolverrecord componentinnerIdResolver- the value for theinnerIdResolverrecord componentouterIdResolver- the value for theouterIdResolverrecord componenttopLevelCollectionFactory- the value for thetopLevelCollectionFactoryrecord componentmapFactory- the value for themapFactoryrecord componentidResolver- the value for theidResolverrecord componentidComparator- the value for theidComparatorrecord componentcollectionFactory- the value for thecollectionFactoryrecord componentcollectionType- the value for thecollectionTyperecord component
-
-
Method Details
-
defaultResultProvider
- Specified by:
defaultResultProviderin interfaceRuleMapperContext<T,TC extends Collection<T>, K, ID, EID, R, RC extends Collection<R>>
-
mapCollector
- Specified by:
mapCollectorin interfaceRuleMapperContext<T,TC extends Collection<T>, K, ID, EID, R, RC extends Collection<R>>
-
streamFlattener
- Specified by:
streamFlattenerin interfaceRuleMapperContext<T,TC extends Collection<T>, K, ID, EID, R, RC extends Collection<R>>
-
mapMerger
- Specified by:
mapMergerin interfaceRuleMapperContext<T,TC extends Collection<T>, K, ID, EID, R, RC extends Collection<R>>
-
convert
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
topLevelIdResolver
Returns the value of thetopLevelIdResolverrecord component.- Specified by:
topLevelIdResolverin interfaceRuleContext<T,TC extends Collection<T>, K, ID, EID, R> - Returns:
- the value of the
topLevelIdResolverrecord component
-
innerIdResolver
Returns the value of theinnerIdResolverrecord component.- Specified by:
innerIdResolverin interfaceRuleContext<T,TC extends Collection<T>, K, ID, EID, R> - Returns:
- the value of the
innerIdResolverrecord component
-
outerIdResolver
Returns the value of theouterIdResolverrecord component.- Specified by:
outerIdResolverin interfaceRuleContext<T,TC extends Collection<T>, K, ID, EID, R> - Returns:
- the value of the
outerIdResolverrecord component
-
topLevelCollectionFactory
Returns the value of thetopLevelCollectionFactoryrecord component.- Specified by:
topLevelCollectionFactoryin interfaceRuleContext<T,TC extends Collection<T>, K, ID, EID, R> - Returns:
- the value of the
topLevelCollectionFactoryrecord component
-
mapFactory
Returns the value of themapFactoryrecord component.- Specified by:
mapFactoryin interfaceRuleContext<T,TC extends Collection<T>, K, ID, EID, R> - Returns:
- the value of the
mapFactoryrecord component
-
idResolver
Returns the value of theidResolverrecord component.- Specified by:
idResolverin interfaceRuleMapperContext<T,TC extends Collection<T>, K, ID, EID, R, RC extends Collection<R>> - Returns:
- the value of the
idResolverrecord component
-
idComparator
Returns the value of theidComparatorrecord component.- Returns:
- the value of the
idComparatorrecord component
-
collectionFactory
Returns the value of thecollectionFactoryrecord component.- Returns:
- the value of the
collectionFactoryrecord component
-
collectionType
Returns the value of thecollectionTyperecord component.- Returns:
- the value of the
collectionTyperecord component
-