Package net.bytebuddy.agent.builder
Class AgentBuilder.RedefinitionStrategy.BatchAllocator.Slicing
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.BatchAllocator.Slicing
-
- All Implemented Interfaces:
AgentBuilder.RedefinitionStrategy.BatchAllocator
- Enclosing interface:
- AgentBuilder.RedefinitionStrategy.BatchAllocator
@Enhance public static class AgentBuilder.RedefinitionStrategy.BatchAllocator.Slicing extends java.lang.Object implements AgentBuilder.RedefinitionStrategy.BatchAllocator
A slicing batch allocator that assures that any batch is within a certain size range.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AgentBuilder.RedefinitionStrategy.BatchAllocator.Slicing.SlicingIterable
An iterable that slices batches into parts of a minimum and maximum size.-
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 AgentBuilder.RedefinitionStrategy.BatchAllocator
batchAllocator
The delegate batch allocator.private int
maximum
The maximum size of each slice.private int
minimum
The minimum size of each slice.-
Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.BatchAllocator
FIRST_BATCH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Slicing(int minimum, int maximum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.
-
Method Summary
All Methods Static 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.static AgentBuilder.RedefinitionStrategy.BatchAllocator
withinRange(int minimum, int maximum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.static AgentBuilder.RedefinitionStrategy.BatchAllocator
withMaximum(int maximum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.static AgentBuilder.RedefinitionStrategy.BatchAllocator
withMinimum(int minimum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.
-
-
-
Field Detail
-
minimum
private final int minimum
The minimum size of each slice.
-
maximum
private final int maximum
The maximum size of each slice.
-
batchAllocator
private final AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator
The delegate batch allocator.
-
-
Constructor Detail
-
Slicing
protected Slicing(int minimum, int maximum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.- Parameters:
minimum
- The minimum size of each slice.maximum
- The maximum size of each slice.batchAllocator
- The delegate batch allocator.
-
-
Method Detail
-
withMinimum
public static AgentBuilder.RedefinitionStrategy.BatchAllocator withMinimum(int minimum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.- Parameters:
minimum
- The minimum size of each slice.batchAllocator
- The delegate batch allocator.- Returns:
- An appropriate slicing batch allocator.
-
withMaximum
public static AgentBuilder.RedefinitionStrategy.BatchAllocator withMaximum(int maximum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.- Parameters:
maximum
- The maximum size of each slice.batchAllocator
- The delegate batch allocator.- Returns:
- An appropriate slicing batch allocator.
-
withinRange
public static AgentBuilder.RedefinitionStrategy.BatchAllocator withinRange(int minimum, int maximum, AgentBuilder.RedefinitionStrategy.BatchAllocator batchAllocator)
Creates a new slicing batch allocator.- Parameters:
minimum
- The minimum size of each slice.maximum
- The maximum size of each slice.batchAllocator
- The delegate batch allocator.- Returns:
- An appropriate slicing 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.
-
-