Top Description Inners Fields Methods
org.easymock.bytebuddy.description.enumeration

public Interface EnumerationDescription

extends NamedElement
Known Direct Implementers
org.easymock.bytebuddy.description.enumeration.EnumerationDescription.AbstractBase
Imports
org.easymock.bytebuddy.build.CachedReturnPlugin, org.easymock.bytebuddy.description.NamedElement, org.easymock.bytebuddy.description.type.TypeDescription, org.easymock.bytebuddy.utility.nullability.MaybeNull, java.util.ArrayList, .List

Describes an enumeration value. Note that the java.lang.Object#toString method always returns the value as if the method was not overridden, i.e. the name of the enumeration constant.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
EnumerationDescription.AbstractBase

An adapter implementation of an enumeration description.

public static class
EnumerationDescription.ForLoadedEnumeration

An enumeration description representing a loaded enumeration.

public static class
EnumerationDescription.Latent

A latent description of an enumeration value.

Field Summary

Inherited from org.easymock.bytebuddy.description.NamedElement:
EMPTY_NAMENO_NAME

Method Summary

Modifier and TypeMethod and Description
public TypeDescription

Returns:

The type of this enumeration.
getEnumerationType
()

Returns the type of this enumeration.

public String

Returns:

The name of this enumeration constant.
getValue
()

Returns the name of this instance's enumeration value.

public <
The enumeration type.
T extends Enum<T>
>
T

Returns:

The loaded enumeration constant corresponding to this value.
load
(Class<T>
A type constant representing the enumeration value.
type
)

Prepares this enumeration value to be loaded.

Inherited from org.easymock.bytebuddy.description.NamedElement:
getActualName

Method Detail

getEnumerationTypeback to summary
public TypeDescription getEnumerationType()

Returns the type of this enumeration.

Returns:TypeDescription

The type of this enumeration.

getValueback to summary
public String getValue()

Returns the name of this instance's enumeration value.

Returns:String

The name of this enumeration constant.

loadback to summary
public <T extends Enum<T>> T load(Class<T> type)

Prepares this enumeration value to be loaded.

Parameters
<T>
The enumeration type.
type:Class<T>

A type constant representing the enumeration value.

Returns:T

The loaded enumeration constant corresponding to this value.

org.easymock.bytebuddy.description.enumeration back to summary

public abstract Class EnumerationDescription.AbstractBase

extends Object
implements EnumerationDescription
Class Inheritance
  • java.lang.Object
  • org.easymock.bytebuddy.description.enumeration.EnumerationDescription.AbstractBase
All Implemented Interfaces
org.easymock.bytebuddy.description.enumeration.EnumerationDescription, org.easymock.bytebuddy.description.NamedElement
Known Direct Subclasses
org.easymock.bytebuddy.description.enumeration.EnumerationDescription.ForLoadedEnumeration, org.easymock.bytebuddy.description.enumeration.EnumerationDescription.Latent

An adapter implementation of an enumeration description.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public String
getActualName()

Implements org.easymock.bytebuddy.description.NamedElement.getActualName.

Returns the display name of this element as it is found in the source code.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Constructor Detail

AbstractBaseback to summary
public AbstractBase()

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getActualNameback to summary
public String getActualName()

Implements org.easymock.bytebuddy.description.NamedElement.getActualName.

Doc from org.easymock.bytebuddy.description.NamedElement.getActualName.

Returns the display name of this element as it is found in the source code. If no such name exists, an empty string is returned.

Returns:String

The name of this element as given in a Java program's source code.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
@Enhance:hashCode
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
org.easymock.bytebuddy.description.enumeration back to summary

public Class EnumerationDescription.ForLoadedEnumeration

extends AbstractBase
Class Inheritance

An enumeration description representing a loaded enumeration.

Field Summary

Modifier and TypeField and Description
private final Enum<?>
value

The loaded enumeration value.

Constructor Summary

AccessConstructor and Description
public
ForLoadedEnumeration(Enum<?>
The value to represent.
value
)

Creates a new enumeration value representation for a loaded enumeration.

Method Summary

Modifier and TypeMethod and Description
public static List<EnumerationDescription>

Returns:

A list of the given enumerations.
asList
(Enum<?>[]
The enumerations to represent.
enumerations
)

Enlists a given array of loaded enumerations as enumeration values.

public TypeDescription
public String
getValue()

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getValue.

Returns the name of this instance's enumeration value.
public <T extends Enum<T>> T
load(Class<T>
A type constant representing the enumeration value.
type
)

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.load.

Prepares this enumeration value to be loaded.
Inherited from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.AbstractBase:
equalsgetActualNamehashCodetoString

Field Detail

valueback to summary
private final Enum<?> value

The loaded enumeration value.

Constructor Detail

ForLoadedEnumerationback to summary
public ForLoadedEnumeration(Enum<?> value)

Creates a new enumeration value representation for a loaded enumeration.

Parameters
value:Enum<?>

The value to represent.

Method Detail

asListback to summary
public static List<EnumerationDescription> asList(Enum<?>[] enumerations)

Enlists a given array of loaded enumerations as enumeration values.

Parameters
enumerations:Enum<?>[]

The enumerations to represent.

Returns:List<EnumerationDescription>

A list of the given enumerations.

getEnumerationTypeback to summary
public TypeDescription getEnumerationType()

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getEnumerationType.

Doc from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getEnumerationType.

Returns the type of this enumeration.

Returns:TypeDescription

The type of this enumeration.

getValueback to summary
public String getValue()

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getValue.

Doc from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getValue.

Returns the name of this instance's enumeration value.

Returns:String

The name of this enumeration constant.

loadback to summary
public <T extends Enum<T>> T load(Class<T> type)

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.load.

Doc from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.load.

Prepares this enumeration value to be loaded.

Parameters
<T>
The enumeration type.
type:Class<T>

A type constant representing the enumeration value.

Returns:T

The loaded enumeration constant corresponding to this value.

Annotations
@SuppressWarnings:unchecked
org.easymock.bytebuddy.description.enumeration back to summary

public Class EnumerationDescription.Latent

extends AbstractBase
Class Inheritance

A latent description of an enumeration value.

Field Summary

Modifier and TypeField and Description
private final TypeDescription
enumerationType

The type of the enumeration.

private final String
value

The value of the enumeration.

Constructor Summary

AccessConstructor and Description
public
Latent(TypeDescription
The enumeration type.
enumerationType
,
String
The value of the enumeration.
value
)

Creates a latent description of an enumeration value.

Method Summary

Modifier and TypeMethod and Description
public TypeDescription
public String
getValue()

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getValue.

Returns the name of this instance's enumeration value.
public <T extends Enum<T>> T
load(Class<T>
A type constant representing the enumeration value.
type
)

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.load.

Prepares this enumeration value to be loaded.
Inherited from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.AbstractBase:
equalsgetActualNamehashCodetoString

Field Detail

enumerationTypeback to summary
private final TypeDescription enumerationType

The type of the enumeration.

valueback to summary
private final String value

The value of the enumeration.

Constructor Detail

Latentback to summary
public Latent(TypeDescription enumerationType, String value)

Creates a latent description of an enumeration value.

Parameters
enumerationType:TypeDescription

The enumeration type.

value:String

The value of the enumeration.

Method Detail

getEnumerationTypeback to summary
public TypeDescription getEnumerationType()

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getEnumerationType.

Doc from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getEnumerationType.

Returns the type of this enumeration.

Returns:TypeDescription

The type of this enumeration.

getValueback to summary
public String getValue()

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getValue.

Doc from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.getValue.

Returns the name of this instance's enumeration value.

Returns:String

The name of this enumeration constant.

loadback to summary
public <T extends Enum<T>> T load(Class<T> type)

Implements org.easymock.bytebuddy.description.enumeration.EnumerationDescription.load.

Doc from org.easymock.bytebuddy.description.enumeration.EnumerationDescription.load.

Prepares this enumeration value to be loaded.

Parameters
<T>
The enumeration type.
type:Class<T>

A type constant representing the enumeration value.

Returns:T

The loaded enumeration constant corresponding to this value.