Package net.bytebuddy.dynamic
Class ClassFileLocator.Resolution.Explicit
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.Resolution.Explicit
- All Implemented Interfaces:
ClassFileLocator.Resolution
- Enclosing interface:
- ClassFileLocator.Resolution
@Enhance
public static class ClassFileLocator.Resolution.Explicit
extends Object
implements ClassFileLocator.Resolution
Represents a byte array as binary data.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator.Resolution
ClassFileLocator.Resolution.Explicit, ClassFileLocator.Resolution.Illegal
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExplicit
(byte[] binaryRepresentation) Creates a new explicit resolution of a given array of binary data. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this binary representation is valid.byte[]
resolve()
Finds the data of this binary representation.
-
Field Details
-
binaryRepresentation
private final byte[] binaryRepresentationThe represented data.
-
-
Constructor Details
-
Explicit
public Explicit(byte[] binaryRepresentation) Creates a new explicit resolution of a given array of binary data.- Parameters:
binaryRepresentation
- The binary data to represent. The array must not be modified.
-
-
Method Details
-
isResolved
public boolean isResolved()Checks if this binary representation is valid.- Specified by:
isResolved
in interfaceClassFileLocator.Resolution
- Returns:
true
if this binary representation is valid.
-
resolve
public byte[] resolve()Finds the data of this binary representation. Calling this method is only legal for resolved instances. For non-resolved instances, an exception is thrown.- Specified by:
resolve
in interfaceClassFileLocator.Resolution
- Returns:
- The requested binary data. The returned array must not be altered.
-