Interface Type
-
- All Superinterfaces:
NamedType
- All Known Subinterfaces:
TypeImpl
- All Known Implementing Classes:
ResolvableType
public interface Type extends NamedType
A JFR type
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypedValueasValue(boolean value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(byte value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(char value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(double value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(float value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(int value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(long value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(short value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(Object value)TypedValueasValue(String value)Shortcut for wrapping the given value instance as a TypedValue objectTypedValueasValue(Consumer<TypedValueBuilder> builderCallback)Shortcut for creating a new TypedValue object for this typebooleancanAccept(Object value)Checks whether the type can accept the given valueList<Annotation>getAnnotations()TypedFieldgetField(String name)List<? extends TypedField>getFields()longgetId()StringgetSupertype()TypesgetTypes()booleanhasConstantPool()booleanisBuiltin()booleanisResolved()booleanisSimple()A simple type has only one field which is of a built-in typebooleanisUsedBy(Type other)Checks whether this particular type is used as a field type in the other type.TypedValuenullValue()TypedValueBuildervalueBuilder()-
Methods inherited from interface org.openjdk.jmc.flightrecorder.writer.api.NamedType
getTypeName, isSame
-
-
-
-
Method Detail
-
getId
long getId()
- Returns:
- unique type ID
-
isBuiltin
boolean isBuiltin()
- Returns:
- is the type built-in or a custom type
-
isSimple
boolean isSimple()
A simple type has only one field which is of a built-in type- Returns:
- true if the type is 'simple'
-
isResolved
boolean isResolved()
- Returns:
- true if the type is fully resolved
-
hasConstantPool
boolean hasConstantPool()
- Returns:
- is the type using constant pool
-
getSupertype
String getSupertype()
- Returns:
- the super type - may be null
-
getFields
List<? extends TypedField> getFields()
- Returns:
- the type field structure
-
getField
TypedField getField(String name)
- Parameters:
name- field name- Returns:
- the
fieldinstance
-
getAnnotations
List<Annotation> getAnnotations()
- Returns:
- attached annotations
-
canAccept
boolean canAccept(Object value)
Checks whether the type can accept the given value- Parameters:
value- the value to check- Returns:
- true only if the type can safely hold the value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(String value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(byte value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(char value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(short value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(int value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(long value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(float value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(double value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(boolean value)
Shortcut for wrapping the given value instance as a TypedValue object- Parameters:
value- the value to wrap- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not accept the given value
-
asValue
TypedValue asValue(Consumer<TypedValueBuilder> builderCallback)
Shortcut for creating a new TypedValue object for this type- Parameters:
builderCallback- will be called when the new TypedValue is being initialized- Returns:
- a TypedValue object representing the typed value
- Throws:
IllegalArgumentException- if the type can not be used with builder callback
-
asValue
TypedValue asValue(Object value)
-
nullValue
TypedValue nullValue()
- Returns:
- a specific TypedValue instance designated as the null value for this type
-
valueBuilder
TypedValueBuilder valueBuilder()
- Returns:
- a new TypedValueBuilder instance for a value of this particular type
-
isUsedBy
boolean isUsedBy(Type other)
Checks whether this particular type is used as a field type in the other type.- Parameters:
other- the other type- Returns:
- true if any of the fields in 'other' type are of this particular type
-
-