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 TypedValue
asValue(boolean value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(byte value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(char value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(double value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(float value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(int value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(long value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(short value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(Object value)
TypedValue
asValue(String value)
Shortcut for wrapping the given value instance as a TypedValue objectTypedValue
asValue(Consumer<TypedValueBuilder> builderCallback)
Shortcut for creating a new TypedValue object for this typeboolean
canAccept(Object value)
Checks whether the type can accept the given valueList<Annotation>
getAnnotations()
TypedField
getField(String name)
List<? extends TypedField>
getFields()
long
getId()
String
getSupertype()
Types
getTypes()
boolean
hasConstantPool()
boolean
isBuiltin()
boolean
isResolved()
boolean
isSimple()
A simple type has only one field which is of a built-in typeboolean
isUsedBy(Type other)
Checks whether this particular type is used as a field type in the other type.TypedValue
nullValue()
TypedValueBuilder
valueBuilder()
-
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
field
instance
-
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
-
-