APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.jfr.internal

public Class Type

extends Object
implements Comparable<Type>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Known Direct Subclasses
jdk.jfr.internal.PlatformEventType
Imports
java.util.ArrayList, .Collection, .Collections, .LinkedHashMap, .List, .Map, .Objects, jdk.internal.module.Checks, jdk.jfr.AnnotationElement, .Event, .SettingControl, .ValueDescriptor, jdk.jfr.internal.util.Utils

Internal data structure that describes a type, Used to create event types, value descriptor and annotations.

Field Summary

Modifier and TypeField and Description
private final AnnotationConstruct
pack-priv static final Type
pack-priv static final Type
pack-priv static final Type
pack-priv static final Type
pack-priv static final Type
public static final String
private List<ValueDescriptor>
pack-priv static final Type
private long
pack-priv static final Type
private boolean
private static final Map<Type, Class<?>>
pack-priv static final Type
private final String
private boolean
public static final String
pack-priv static final Type
private Boolean
public static final Type
pack-priv static final Type
public static final String
public static final String
public static final String
private final String
pack-priv static final Type
public static final String
private boolean

Constructor Summary

AccessConstructor and Description
public
Type(String
i.e "java.lang.String"
javaTypeName
,
String
i.e "java.lang.Annotation"
superType
,
long
the class id that represents the class in the JVM
typeId
)

Creates a type

pack-priv
Type(String javaTypeName, String superType, long typeId, Boolean simpleType)

Method Summary

Modifier and TypeMethod and Description
public void
add(ValueDescriptor valueDescriptor)

private boolean
public int
compareTo(Type that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

private static Type
private static Type
createKnownType(String name, Class<?> clazz)

public boolean
equals(Object object)

Overrides java.lang.Object.equals.

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

public <T> T
getAnnotation(Class<? extends Annotation> clazz)

public List<AnnotationElement>
public <T> T
getAnnotationValue(Class<? extends Annotation> clazz, T defaultValue)

public String
public ValueDescriptor
public List<ValueDescriptor>
public long
public static Type
getKnownType(String typeName)

public static Type
getKnownType(Class<?> clazz)

pack-priv static Collection<Type>
public String
public String
public String
public boolean
public String
public static long
getTypeId(Class<?> clazz)

public boolean
hasAnnotation(Class<? extends Annotation> clazz)

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public int
pack-priv static boolean
isDefinedByJVM(long id)

public boolean
public boolean
public static boolean
isKnownType(Class<?> type)

public boolean
public static boolean
public boolean
pack-priv void
log(String action, LogTag logTag, LogLevel level)

pack-priv void
public void
public void
setId(long id)

public void
setInternal(boolean internal)

public void
setRemove(boolean remove)

public void
setVisible(boolean visible)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

pack-priv void
private String
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

annosback to summary
private final AnnotationConstruct annos
BOOLEANback to summary
pack-priv static final Type BOOLEAN
BYTEback to summary
pack-priv static final Type BYTE
CHARback to summary
pack-priv static final Type CHAR
CLASSback to summary
pack-priv static final Type CLASS
DOUBLEback to summary
pack-priv static final Type DOUBLE
EVENT_NAME_PREFIXback to summary
public static final String EVENT_NAME_PREFIX
fieldsback to summary
private List<ValueDescriptor> fields
FLOATback to summary
pack-priv static final Type FLOAT
idback to summary
private long id
INTback to summary
pack-priv static final Type INT
internalback to summary
private boolean internal
knownTypesback to summary
private static final Map<Type, Class<?>> knownTypes
LONGback to summary
pack-priv static final Type LONG
nameback to summary
private final String name
removeback to summary
private boolean remove
SETTINGS_PREFIXback to summary
public static final String SETTINGS_PREFIX
SHORTback to summary
pack-priv static final Type SHORT
simpleTypeback to summary
private Boolean simpleType
STACK_TRACEback to summary
public static final Type STACK_TRACE
STRINGback to summary
pack-priv static final Type STRING
SUPER_TYPE_ANNOTATIONback to summary
public static final String SUPER_TYPE_ANNOTATION
SUPER_TYPE_EVENTback to summary
public static final String SUPER_TYPE_EVENT
SUPER_TYPE_SETTINGback to summary
public static final String SUPER_TYPE_SETTING
superTypeback to summary
private final String superType
THREADback to summary
pack-priv static final Type THREAD
TYPES_PREFIXback to summary
public static final String TYPES_PREFIX
visibleback to summary
private boolean visible

Constructor Detail

Typeback to summary
public Type(String javaTypeName, String superType, long typeId)

Creates a type

Parameters
javaTypeName:String

i.e "java.lang.String"

superType:String

i.e "java.lang.Annotation"

typeId:long

the class id that represents the class in the JVM

Typeback to summary
pack-priv Type(String javaTypeName, String superType, long typeId, Boolean simpleType)

Method Detail

addback to summary
public void add(ValueDescriptor valueDescriptor)
calculateSimpleTypeback to summary
private boolean calculateSimpleType()
compareToback to summary
public int compareTo(Type that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
createKnownTypeback to summary
private static Type createKnownType(Class<?> clazz)
createKnownTypeback to summary
private static Type createKnownType(String name, Class<?> clazz)
equalsback to summary
public boolean equals(Object object)

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.

Annotations
@Override
getAnnotationback to summary
public <T> T getAnnotation(Class<? extends Annotation> clazz)
getAnnotationElementsback to summary
public List<AnnotationElement> getAnnotationElements()
getAnnotationValueback to summary
public <T> T getAnnotationValue(Class<? extends Annotation> clazz, T defaultValue)
getDescriptionback to summary
public String getDescription()
getFieldback to summary
public ValueDescriptor getField(String name)
getFieldsback to summary
public List<ValueDescriptor> getFields()
getIdback to summary
public long getId()
getKnownTypeback to summary
public static Type getKnownType(String typeName)
getKnownTypeback to summary
public static Type getKnownType(Class<?> clazz)
getKnownTypesback to summary
pack-priv static Collection<Type> getKnownTypes()
getLabelback to summary
public String getLabel()
getLogNameback to summary
public String getLogName()
getNameback to summary
public String getName()
getRemoveback to summary
public boolean getRemove()
getSuperTypeback to summary
public String getSuperType()
getTypeIdback to summary
public static long getTypeId(Class<?> clazz)
hasAnnotationback to summary
public boolean hasAnnotation(Class<? extends Annotation> clazz)
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.
Annotations
@Override
indexOfback to summary
public int indexOf(String name)
isDefinedByJVMback to summary
pack-priv static boolean isDefinedByJVM(long id)
isDefinedByJVMback to summary
public boolean isDefinedByJVM()
isInternalback to summary
public boolean isInternal()
isKnownTypeback to summary
public static boolean isKnownType(Class<?> type)
isSimpleTypeback to summary
public boolean isSimpleType()
isValidJavaFieldTypeback to summary
public static boolean isValidJavaFieldType(String name)
isVisibleback to summary
public boolean isVisible()
logback to summary
pack-priv void log(String action, LogTag logTag, LogLevel level)
setAnnotationsback to summary
pack-priv void setAnnotations(List<AnnotationElement> annotations)
setFieldsback to summary
public void setFields(List<ValueDescriptor> fields)
setIdback to summary
public void setId(long id)
setInternalback to summary
public void setInternal(boolean internal)
setRemoveback to summary
public void setRemove(boolean remove)
setVisibleback to summary
public void setVisible(boolean visible)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
trimFieldsback to summary
pack-priv void trimFields()
typeTextback to summary
private String typeText()