Top Description Fields Constructors Methods
net.bytebuddy.dynamic.scaffold

public final Enum TypeValidation

extends Enum<TypeValidation>
Class Inheritance

If type validation is enabled, Byte Buddy performs several checks to ensure that a generated class file is specified in a valid manner. This involves checks of the generated instrumented type and checks of the generated byte code. Byte Buddy's net.bytebuddy.implementation.Implementation instances perform their own checks, independently of any type validation.

The JVM's verifier performs its own checks; an illegal class file is never loaded. However, Byte Buddy's checks might be more expressive in the context of using the library. Also, Byte Buddy emits exceptions at class creation time while the JVM emits errors at class loading time.

Field Summary

Modifier and TypeField and Description
public static final TypeValidation
DISABLED

Disables Byte Buddy's validation.

public static final TypeValidation
ENABLED

Enables Byte Buddy's validation.

private final boolean
enabled

true if type validation is enabled.

Constructor Summary

AccessConstructor and Description
private
TypeValidation(boolean
true if type validation is enabled.
enabled
)

Creates a new type validation enumeration.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if type validation is enabled.
isEnabled
()

Returns true if type validation is enabled.

public static TypeValidation

Returns:

A suitable type validation representation.
of
(boolean
true if type validation should be enabled.
enabled
)

Returns TypeValidation#ENABLED if the supplied argument is true.

public static TypeValidation
public static TypeValidation[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DISABLEDback to summary
public static final TypeValidation DISABLED

Disables Byte Buddy's validation.

ENABLEDback to summary
public static final TypeValidation ENABLED

Enables Byte Buddy's validation.

enabledback to summary
private final boolean enabled

true if type validation is enabled.

Constructor Detail

TypeValidationback to summary
private TypeValidation(boolean enabled)

Creates a new type validation enumeration.

Parameters
enabled:boolean

true if type validation is enabled.

Method Detail

isEnabledback to summary
public boolean isEnabled()

Returns true if type validation is enabled.

Returns:boolean

true if type validation is enabled.

ofback to summary
public static TypeValidation of(boolean enabled)

Returns TypeValidation#ENABLED if the supplied argument is true.

Parameters
enabled:boolean

true if type validation should be enabled.

Returns:TypeValidation

A suitable type validation representation.

valueOfback to summary
public static TypeValidation valueOf(String name)
valuesback to summary
public static TypeValidation[] values()