Record Class CacheContext.OneToManyCacheContext<ID,EID,R,RC extends Collection<R>>

java.lang.Object
java.lang.Record
io.github.pellse.assembler.caching.CacheContext.OneToManyCacheContext<ID,EID,R,RC>
All Implemented Interfaces:
CacheContext<ID,R,RC>
Enclosing interface:
CacheContext<ID,R,RRC>

public static record CacheContext.OneToManyCacheContext<ID,EID,R,RC extends Collection<R>>(Function<R,EID> idResolver, IntFunction<Collector<R,?,Map<ID,RC extends Collection<R>>>> mapCollector, BiFunction<Map<ID,RC extends Collection<R>>,Map<ID,RC extends Collection<R>>,Map<ID,RC extends Collection<R>>> mapMerger, Comparator<R> idComparator, Supplier<RC extends Collection<R>> collectionFactory) extends Record implements CacheContext<ID,R,RC>
  • Constructor Details

    • OneToManyCacheContext

      public OneToManyCacheContext(Function<R,EID> idResolver, IntFunction<Collector<R,?,Map<ID,RC>>> mapCollector, BiFunction<Map<ID,RC>,Map<ID,RC>,Map<ID,RC>> mapMerger, Comparator<R> idComparator, Supplier<RC> collectionFactory)
      Creates an instance of a OneToManyCacheContext record class.
      Parameters:
      idResolver - the value for the idResolver record component
      mapCollector - the value for the mapCollector record component
      mapMerger - the value for the mapMerger record component
      idComparator - the value for the idComparator record component
      collectionFactory - the value for the collectionFactory record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • idResolver

      public Function<R,EID> idResolver()
      Returns the value of the idResolver record component.
      Returns:
      the value of the idResolver record component
    • mapCollector

      public IntFunction<Collector<R,?,Map<ID,RC>>> mapCollector()
      Returns the value of the mapCollector record component.
      Specified by:
      mapCollector in interface CacheContext<ID,EID,R>
      Returns:
      the value of the mapCollector record component
    • mapMerger

      public BiFunction<Map<ID,RC>,Map<ID,RC>,Map<ID,RC>> mapMerger()
      Returns the value of the mapMerger record component.
      Specified by:
      mapMerger in interface CacheContext<ID,EID,R>
      Returns:
      the value of the mapMerger record component
    • idComparator

      public Comparator<R> idComparator()
      Returns the value of the idComparator record component.
      Returns:
      the value of the idComparator record component
    • collectionFactory

      public Supplier<RC> collectionFactory()
      Returns the value of the collectionFactory record component.
      Returns:
      the value of the collectionFactory record component