Package net.bytebuddy.agent.builder
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.BatchAllocator
AgentBuilder.RedefinitionStrategy.BatchAllocator.ForFixedSize, AgentBuilder.RedefinitionStrategy.BatchAllocator.ForMatchedGrouping, AgentBuilder.RedefinitionStrategy.BatchAllocator.ForTotal, AgentBuilder.RedefinitionStrategy.BatchAllocator.Partitioning, AgentBuilder.RedefinitionStrategy.BatchAllocator.Slicing
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection
<? extends ElementMatcher<? super TypeDescription>> The type matchers to apply.Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.BatchAllocator
FIRST_BATCH
-
Constructor Summary
ConstructorsConstructorDescriptionForMatchedGrouping
(Collection<? extends ElementMatcher<? super TypeDescription>> matchers) Creates a new batch allocator that groups all batches by discriminating types using a type matcher.ForMatchedGrouping
(ElementMatcher<? super TypeDescription>... matcher) Creates a new batch allocator that groups all batches by discriminating types using a type matcher. -
Method Summary
Modifier and TypeMethodDescriptionSplits a list of types to be retransformed into separate batches.withinRange
(int minimum, int maximum) Assures that any group is within a size range described by the supplied minimum and maximum.withMaximum
(int threshold) Assures that any group is at least of a given size.withMinimum
(int threshold) Assures that any group is at least of a given size.
-
Field Details
-
matchers
The type matchers to apply.
-
-
Constructor Details
-
ForMatchedGrouping
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
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
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
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
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
Splits a list of types to be retransformed into separate batches.- Specified by:
batch
in interfaceAgentBuilder.RedefinitionStrategy.BatchAllocator
- Parameters:
types
- A list of types which should be retransformed.- Returns:
- An iterable of retransformations within a batch.
-