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

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

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, Comparator<R> idComparator, Supplier<RC extends Collection<R>> collectionFactory, Class<RC extends Collection<R>> collectionType, MergeFunction<ID,RC extends Collection<R>> mergeFunction, CacheFactory.CacheTransformer<ID,R,RC extends Collection<R>,CacheContext.OneToManyCacheContext<ID,EID,R,RC extends Collection<R>>> cacheTransformer) extends Record implements CacheContext<ID,R,RC,CacheContext.OneToManyCacheContext<ID,EID,R,RC>>
  • Constructor Details

    • OneToManyCacheContext

      public OneToManyCacheContext(Function<R,EID> idResolver, IntFunction<Collector<R,?,Map<ID,RC>>> mapCollector, Comparator<R> idComparator, Supplier<RC> collectionFactory, Class<RC> collectionType, MergeFunction<ID,RC> mergeFunction, CacheFactory.CacheTransformer<ID,R,RC,CacheContext.OneToManyCacheContext<ID,EID,R,RC>> cacheTransformer)
      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
      idComparator - the value for the idComparator record component
      collectionFactory - the value for the collectionFactory record component
      collectionType - the value for the collectionType record component
      mergeFunction - the value for the mergeFunction record component
      cacheTransformer - the value for the cacheTransformer 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,RC extends Collection<R>>
      Returns:
      the value of the mapCollector 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
    • collectionType

      public Class<RC> collectionType()
      Returns the value of the collectionType record component.
      Returns:
      the value of the collectionType record component
    • mergeFunction

      public MergeFunction<ID,RC> mergeFunction()
      Returns the value of the mergeFunction record component.
      Specified by:
      mergeFunction in interface CacheContext<ID,EID,R,RC extends Collection<R>>
      Returns:
      the value of the mergeFunction record component
    • cacheTransformer

      Returns the value of the cacheTransformer record component.
      Specified by:
      cacheTransformer in interface CacheContext<ID,EID,R,RC extends Collection<R>>
      Returns:
      the value of the cacheTransformer record component