Class Types
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.writer.api.Types
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypes.BuiltinBuilt-in typesstatic classTypes.JDKTypes (subset of) defined by the JFR JVM implementationstatic interfaceTypes.PredefinedAtypepredefined by the writer
-
Constructor Summary
Constructors Constructor Description Types()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract TypedFieldBuilderfieldBuilder(String fieldName, Type fieldType)abstract TypedFieldBuilderfieldBuilder(String fieldName, Types.Builtin fieldType)abstract TypegetOrAdd(String name, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.abstract TypegetOrAdd(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 TypegetOrAdd(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 TypegetOrAdd(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.abstract TypegetOrAdd(String name, String supertype, TypeStructure typeStructure)Retrieve the given type or create it a-new if it hasn't been added yet.abstract TypegetOrAdd(String name, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.abstract TypegetOrAdd(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 TypegetOrAdd(Types.Predefined type, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.abstract TypegetType(String name)Retrieve the type by its name.abstract TypegetType(String name, boolean asResolvable)Retrieve the type by its name.abstract TypegetType(Types.Predefined type)A convenience shortcut to get a Type instance corresponding to the Types.Predefined typeabstract TypeStructureBuildertypeStructureBuilder()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
typeinstance
-
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
typeinstance
-
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
typeinstance
-
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
typeinstance
-
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
typeinstance
-
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
typeinstance
-
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
typeinstance
-
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
typeinstance
-
getType
public abstract Type getType(String name)
Retrieve the type by its name.- Parameters:
name- the type name- Returns:
- the registered
typeor 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
Typetype, 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
-
-