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 aModelCache
. This interface basically aggregates a name and a class to provide some type safety when working with the otherwise untyped cache.
-
-
Field Summary
Fields Modifier and Type Field Description static ModelCacheTag<DependencyManagement>
IMPORT
The tag used to denote an effective dependency management section from an imported model.static ModelCacheTag<ModelData>
RAW
The tag used to denote raw model data.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
fromCache(T data)
Creates a copy of the data suitable for retrieval from the cache.java.lang.String
getName()
Gets the name of the tag.java.lang.Class<T>
getType()
Gets the type of data associated with this tag.T
intoCache(T data)
Creates a copy of the data suitable for storage in the cache.
-
-
-
Field Detail
-
RAW
static final ModelCacheTag<ModelData> RAW
The tag used to denote raw model data.
-
IMPORT
static final ModelCacheTag<DependencyManagement> IMPORT
The tag used to denote an effective dependency management section from an imported model.
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the tag.- Returns:
- The name of the tag, must not be
null
.
-
getType
java.lang.Class<T> getType()
Gets the type of data associated with this tag.- Returns:
- The type of data, must not be
null
.
-
intoCache
T intoCache(T data)
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
T fromCache(T data)
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
.
-
-