Class Types
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.writer.api.Types
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Types.Builtin
Built-in typesstatic class
Types.JDK
Types (subset of) defined by the JFR JVM implementationstatic interface
Types.Predefined
Atype
predefined by the writer
-
Constructor Summary
Constructors Constructor Description Types()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract TypedFieldBuilder
fieldBuilder(String fieldName, Type fieldType)
abstract TypedFieldBuilder
fieldBuilder(String fieldName, Types.Builtin fieldType)
abstract Type
getOrAdd(String name, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(String name, String supertype, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(String name, String supertype, boolean withConstantPool, TypeStructure typeStructure)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(String name, String supertype, TypeStructure typeStructure)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(String name, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(Types.Predefined type, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getOrAdd(Types.Predefined type, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.abstract Type
getType(String name)
Retrieve the type by its name.abstract Type
getType(String name, boolean asResolvable)
Retrieve the type by its name.abstract Type
getType(Types.Predefined type)
A convenience shortcut to get a Type instance corresponding to the Types.Predefined typeabstract TypeStructureBuilder
typeStructureBuilder()
A convenience accessor to TypeStructureBuilder instance outside of the type configuration callback
-
-
-
Method Detail
-
getOrAdd
public abstract Type getOrAdd(Types.Predefined type, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet. The type values will be stored in an associated constant pool.- Parameters:
type
- the type to retrievebuilderCallback
- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(String name, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.- Parameters:
name
- the name of the type to retrievebuilderCallback
- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(String name, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.- Parameters:
name
- the name of the type to retrievewithConstantPool
- should the type values use an associated constant poolbuilderCallback
- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(Types.Predefined type, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.- Parameters:
type
- the type to retrievesupertype
- the super type namebuilderCallback
- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet. The type values will be stored in an associated constant pool.- Parameters:
name
- the name of the type to retrievesupertype
- the super type namebuilderCallback
- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(String name, String supertype, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.- Parameters:
name
- the name of the type to retrievesupertype
- the super type namewithConstantPool
- should the type values use an associated constant poolbuilderCallback
- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(String name, String supertype, TypeStructure typeStructure)
Retrieve the given type or create it a-new if it hasn't been added yet. The type values will be stored in an associated constant pool.- Parameters:
name
- the name of the type to retrievesupertype
- the super type nametypeStructure
- the type structure definition- Returns:
- the corresponding
type
instance
-
getOrAdd
public abstract Type getOrAdd(String name, String supertype, boolean withConstantPool, TypeStructure typeStructure)
Retrieve the given type or create it a-new if it hasn't been added yet.- Parameters:
name
- the name of the type to retrievesupertype
- the super type namewithConstantPool
- should the type values use an associated constant pooltypeStructure
- the type structure definition- Returns:
- the corresponding
type
instance
-
getType
public abstract Type getType(String name)
Retrieve the type by its name.- Parameters:
name
- the type name- Returns:
- the registered
type
or null
-
getType
public abstract Type getType(String name, boolean asResolvable)
Retrieve the type by its name. If the type hasn't been added yet a ResolvableType wrapper may be returned.- Parameters:
name
- the type nameasResolvable
- if true a ResolvableType wrapper will be returned instead of null for non-existent type- Returns:
- an existing
Type
type, null or a ResolvableType wrapper
-
getType
public abstract Type getType(Types.Predefined type)
A convenience shortcut to get a Type instance corresponding to the Types.Predefined type- Parameters:
type
- the predefined/enum type- Returns:
- the registered Type instance or a ResolvableType wrapper
-
typeStructureBuilder
public abstract TypeStructureBuilder typeStructureBuilder()
A convenience accessor to TypeStructureBuilder instance outside of the type configuration callback- Returns:
- a new TypeStructureBuilder instance
-
fieldBuilder
public abstract TypedFieldBuilder fieldBuilder(String fieldName, Type fieldType)
- Parameters:
fieldName
- field namefieldType
- field type- Returns:
- a new TypedFieldBuilder instance for a named field of the given type
-
fieldBuilder
public abstract TypedFieldBuilder fieldBuilder(String fieldName, Types.Builtin fieldType)
- Parameters:
fieldName
- field namefieldType
- field type- Returns:
- a new TypedFieldBuilder instance for a named field of the given type
-
-