Package org.apache.maven.model.building
Interface ModelCacheTag<T>
- Type Parameters:
T
- The type of data associated with the tag.
interface ModelCacheTag<T>
Describes a tag used by the model builder to access a
ModelCache
. This interface basically aggregates a name
and a class to provide some type safety when working with the otherwise untyped cache.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ModelCacheTag<DependencyManagement>
The tag used to denote an effective dependency management section from an imported model.static final ModelCacheTag<ModelData>
The tag used to denote raw model data. -
Method Summary
-
Field Details
-
RAW
The tag used to denote raw model data. -
IMPORT
The tag used to denote an effective dependency management section from an imported model.
-
-
Method Details
-
getName
String getName()Gets the name of the tag.- Returns:
- The name of the tag, must not be
null
.
-
getType
Gets the type of data associated with this tag.- Returns:
- The type of data, must not be
null
.
-
intoCache
Creates a copy of the data suitable for storage in the cache. The original data to store can be mutated after the cache is populated but the state of the cache must not change so we need to make a copy.- Parameters:
data
- The data to store in the cache, must not benull
.- Returns:
- The data being stored in the cache, never
null
.
-
fromCache
Creates a copy of the data suitable for retrieval from the cache. The retrieved data can be mutated after the cache is queried but the state of the cache must not change so we need to make a copy.- Parameters:
data
- The data to retrieve from the cache, must not benull
.- Returns:
- The data being retrieved from the cache, never
null
.
-