Class AgentBuilder.RedefinitionStrategy.BatchAllocator.ForMatchedGrouping

java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.BatchAllocator.ForMatchedGrouping
All Implemented Interfaces:
AgentBuilder.RedefinitionStrategy.BatchAllocator
Enclosing interface:
AgentBuilder.RedefinitionStrategy.BatchAllocator

@Enhance public static class AgentBuilder.RedefinitionStrategy.BatchAllocator.ForMatchedGrouping extends Object implements AgentBuilder.RedefinitionStrategy.BatchAllocator
A batch allocator that groups all batches by discriminating types using a type matcher.
  • Field Details

  • Constructor Details

    • ForMatchedGrouping

      public ForMatchedGrouping(ElementMatcher<? super TypeDescription>... matcher)
      Creates a new batch allocator that groups all batches by discriminating types using a type matcher. All batches are applied in their application order with any unmatched type being included in the last batch.
      Parameters:
      matcher - The type matchers to apply in their application order.
    • ForMatchedGrouping

      public ForMatchedGrouping(Collection<? extends ElementMatcher<? super TypeDescription>> matchers)
      Creates a new batch allocator that groups all batches by discriminating types using a type matcher. All batches are applied in their application order with any unmatched type being included in the last batch.
      Parameters:
      matchers - The type matchers to apply in their application order.
  • Method Details

    • withMinimum

      public AgentBuilder.RedefinitionStrategy.BatchAllocator withMinimum(int threshold)
      Assures that any group is at least of a given size. If a group is smaller than a given size, it is merged with its types are merged with its subsequent group(s) as long as such groups exist.
      Parameters:
      threshold - The minimum threshold for any batch.
      Returns:
      An appropriate batch allocator.
    • withMaximum

      public AgentBuilder.RedefinitionStrategy.BatchAllocator withMaximum(int threshold)
      Assures that any group is at least of a given size. If a group is bigger than a given size, it is split into two several batches.
      Parameters:
      threshold - The maximum threshold for any batch.
      Returns:
      An appropriate batch allocator.
    • withinRange

      public AgentBuilder.RedefinitionStrategy.BatchAllocator withinRange(int minimum, int maximum)
      Assures that any group is within a size range described by the supplied minimum and maximum. Groups are split and merged according to the supplied thresholds. The last group contains might be smaller than the supplied minimum.
      Parameters:
      minimum - The minimum threshold for any batch.
      maximum - The maximum threshold for any batch.
      Returns:
      An appropriate batch allocator.
    • batch

      public Iterable<? extends List<Class<?>>> batch(List<Class<?>> types)
      Splits a list of types to be retransformed into separate batches.
      Specified by:
      batch in interface AgentBuilder.RedefinitionStrategy.BatchAllocator
      Parameters:
      types - A list of types which should be retransformed.
      Returns:
      An iterable of retransformations within a batch.