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 java.lang.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
Fields Modifier and Type Field Description private java.util.Collection<? extends ElementMatcher<? super TypeDescription>>
matchers
The type matchers to apply.-
Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.BatchAllocator
FIRST_BATCH
-
-
Constructor Summary
Constructors Constructor Description ForMatchedGrouping(java.util.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<? extends java.util.List<java.lang.Class<?>>>
batch(java.util.List<java.lang.Class<?>> types)
Splits a list of types to be retransformed into separate batches.AgentBuilder.RedefinitionStrategy.BatchAllocator
withinRange(int minimum, int maximum)
Assures that any group is within a size range described by the supplied minimum and maximum.AgentBuilder.RedefinitionStrategy.BatchAllocator
withMaximum(int threshold)
Assures that any group is at least of a given size.AgentBuilder.RedefinitionStrategy.BatchAllocator
withMinimum(int threshold)
Assures that any group is at least of a given size.
-
-
-
Field Detail
-
matchers
private final java.util.Collection<? extends ElementMatcher<? super TypeDescription>> matchers
The type matchers to apply.
-
-
Constructor Detail
-
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(java.util.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 Detail
-
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 java.lang.Iterable<? extends java.util.List<java.lang.Class<?>>> batch(java.util.List<java.lang.Class<?>> types)
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.
-
-