Top Description Inners Fields Methods
net.bytebuddy.description.type

public Interface PackageDescription

extends WithRuntimeName, AnnotationSource
Known Direct Implementers
net.bytebuddy.description.type.PackageDescription.AbstractBase
Imports
net.bytebuddy.description.NamedElement, net.bytebuddy.description.annotation.AnnotationList, .AnnotationSource, net.bytebuddy.utility.nullability.AlwaysNull, .MaybeNull, net.bytebuddy.jar.asm.Opcodes

A package description represents a Java package.

Nested and Inner Type Summary

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

An abstract base implementation of a package description.

public static class
public static class
PackageDescription.Simple

A simple implementation of a package without annotations.

Field Summary

Modifier and TypeField and Description
public static final PackageDescription
DEFAULT

A representation of the default package without any annotations.

public static final String
PACKAGE_CLASS_NAME

The name of a Java class representing a package description.

public static final int
PACKAGE_MODIFIERS

The modifiers of a Java class representing a package description.

public static final PackageDescription
UNDEFINED

A named constant for an undefined package what applies for primitive and array types.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the given type contains the provided type.
contains
(TypeDescription
The type to examine.
typeDescription
)

Checks if this package contains the provided type.

public boolean

Returns:

true if this package description represents the default package.
isDefault
()

Returns true if this package description represents the default package.

Inherited from net.bytebuddy.description.annotation.AnnotationSource:
getDeclaredAnnotations
Inherited from net.bytebuddy.description.NamedElement.WithRuntimeName:
getInternalNamegetName

Field Detail

DEFAULTback to summary
public static final PackageDescription DEFAULT

A representation of the default package without any annotations.

PACKAGE_CLASS_NAMEback to summary
public static final String PACKAGE_CLASS_NAME

The name of a Java class representing a package description.

PACKAGE_MODIFIERSback to summary
public static final int PACKAGE_MODIFIERS

The modifiers of a Java class representing a package description.

UNDEFINEDback to summary
public static final PackageDescription UNDEFINED

A named constant for an undefined package what applies for primitive and array types.

Annotations
@AlwaysNull

Method Detail

containsback to summary
public boolean contains(TypeDescription typeDescription)

Checks if this package contains the provided type.

Parameters
typeDescription:TypeDescription

The type to examine.

Returns:boolean

true if the given type contains the provided type.

isDefaultback to summary
public boolean isDefault()

Returns true if this package description represents the default package.

Returns:boolean

true if this package description represents the default package.

net.bytebuddy.description.type back to summary

public abstract Class PackageDescription.AbstractBase

extends Object
implements PackageDescription
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.description.type.PackageDescription.AbstractBase
All Implemented Interfaces
net.bytebuddy.description.type.PackageDescription, net.bytebuddy.description.annotation.AnnotationSource, net.bytebuddy.description.NamedElement.WithRuntimeName, net.bytebuddy.description.NamedElement
Known Direct Subclasses
net.bytebuddy.description.type.PackageDescription.Simple, net.bytebuddy.description.type.PackageDescription.ForLoadedPackage, net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.LazyPackageDescription

An abstract base implementation of a package description.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(TypeDescription
The type to examine.
typeDescription
)

Implements net.bytebuddy.description.type.PackageDescription.contains.

Checks if this package contains the provided type.
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 net.bytebuddy.description.NamedElement.getActualName.

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

Implements net.bytebuddy.description.NamedElement.WithRuntimeName.getInternalName.

Returns the internal name of this byte code element.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
isDefault()

Implements net.bytebuddy.description.type.PackageDescription.isDefault.

Returns true if this package description represents the default package.
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

containsback to summary
public boolean contains(TypeDescription typeDescription)

Implements net.bytebuddy.description.type.PackageDescription.contains.

Doc from net.bytebuddy.description.type.PackageDescription.contains.

Checks if this package contains the provided type.

Parameters
typeDescription:TypeDescription

The type to examine.

Returns:boolean

true if the given type contains the provided type.

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 net.bytebuddy.description.NamedElement.getActualName.

Doc from net.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.

getInternalNameback to summary
public String getInternalName()

Implements net.bytebuddy.description.NamedElement.WithRuntimeName.getInternalName.

Doc from net.bytebuddy.description.NamedElement.WithRuntimeName.getInternalName.

Returns the internal name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.

Returns:String

The internal name of this byte code element as used within the Java class file format.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the 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
isDefaultback to summary
public boolean isDefault()

Implements net.bytebuddy.description.type.PackageDescription.isDefault.

Doc from net.bytebuddy.description.type.PackageDescription.isDefault.

Returns true if this package description represents the default package.

Returns:boolean

true if this package description represents the default package.

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
net.bytebuddy.description.type back to summary

public Class PackageDescription.ForLoadedPackage

extends AbstractBase
Class Inheritance

Represents a loaded java.lang.Package wrapped as a PackageDescription.

Field Summary

Modifier and TypeField and Description
private final Package
aPackage

The represented package.

Constructor Summary

AccessConstructor and Description
public
ForLoadedPackage(Package
The represented package.
aPackage
)

Creates a new loaded package representation.

Method Summary

Modifier and TypeMethod and Description
public AnnotationList
getDeclaredAnnotations()

Implements net.bytebuddy.description.annotation.AnnotationSource.getDeclaredAnnotations.

Returns a list of annotations that are declared by this instance.
public String
getName()

Implements net.bytebuddy.description.NamedElement.WithRuntimeName.getName.

Returns the binary name of this byte code element.
Inherited from net.bytebuddy.description.type.PackageDescription.AbstractBase:
containsequalsgetActualNamegetInternalNamehashCodeisDefaulttoString

Field Detail

aPackageback to summary
private final Package aPackage

The represented package.

Constructor Detail

ForLoadedPackageback to summary
public ForLoadedPackage(Package aPackage)

Creates a new loaded package representation.

Parameters
aPackage:Package

The represented package.

Method Detail

getDeclaredAnnotationsback to summary
public AnnotationList getDeclaredAnnotations()

Implements net.bytebuddy.description.annotation.AnnotationSource.getDeclaredAnnotations.

Doc from net.bytebuddy.description.annotation.AnnotationSource.getDeclaredAnnotations.

Returns a list of annotations that are declared by this instance.

Returns:AnnotationList

A list of declared annotations.

getNameback to summary
public String getName()

Implements net.bytebuddy.description.NamedElement.WithRuntimeName.getName.

Doc from net.bytebuddy.description.NamedElement.WithRuntimeName.getName.

Returns the binary name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.

Returns:String

The binary ame of this byte code element as visible from within a running Java application.

net.bytebuddy.description.type back to summary

public Class PackageDescription.Simple

extends AbstractBase
Class Inheritance

A simple implementation of a package without annotations.

Field Summary

Modifier and TypeField and Description
private final String
name

The name of the package.

Constructor Summary

AccessConstructor and Description
public
Simple(String
The name of the package.
name
)

Creates a new simple package.

Method Summary

Modifier and TypeMethod and Description
public AnnotationList
getDeclaredAnnotations()

Implements net.bytebuddy.description.annotation.AnnotationSource.getDeclaredAnnotations.

Returns a list of annotations that are declared by this instance.
public String
getName()

Implements net.bytebuddy.description.NamedElement.WithRuntimeName.getName.

Returns the binary name of this byte code element.
Inherited from net.bytebuddy.description.type.PackageDescription.AbstractBase:
containsequalsgetActualNamegetInternalNamehashCodeisDefaulttoString

Field Detail

nameback to summary
private final String name

The name of the package.

Constructor Detail

Simpleback to summary
public Simple(String name)

Creates a new simple package.

Parameters
name:String

The name of the package.

Method Detail

getDeclaredAnnotationsback to summary
public AnnotationList getDeclaredAnnotations()

Implements net.bytebuddy.description.annotation.AnnotationSource.getDeclaredAnnotations.

Doc from net.bytebuddy.description.annotation.AnnotationSource.getDeclaredAnnotations.

Returns a list of annotations that are declared by this instance.

Returns:AnnotationList

A list of declared annotations.

getNameback to summary
public String getName()

Implements net.bytebuddy.description.NamedElement.WithRuntimeName.getName.

Doc from net.bytebuddy.description.NamedElement.WithRuntimeName.getName.

Returns the binary name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.

Returns:String

The binary ame of this byte code element as visible from within a running Java application.