public enum TypeValidation extends Enum<TypeValidation>
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 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.
Enum Constant and Description |
---|
DISABLED
Disables Byte Buddy's validation.
|
ENABLED
Enables Byte Buddy's validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isEnabled()
Returns
true if type validation is enabled. |
static TypeValidation |
of(boolean enabled)
Returns
ENABLED if the supplied argument is true . |
static TypeValidation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TypeValidation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TypeValidation ENABLED
public static final TypeValidation DISABLED
public static TypeValidation[] values()
for (TypeValidation c : TypeValidation.values()) System.out.println(c);
public static TypeValidation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static TypeValidation of(boolean enabled)
ENABLED
if the supplied argument is true
.enabled
- true
if type validation should be enabled.public boolean isEnabled()
true
if type validation is enabled.true
if type validation is enabled.Copyright © 2014–2020. All rights reserved.