Package net.kyori.indra.git
Class MappedRepositoryValueSource<I,V,P extends RepositoryValueSource.Parameters>
java.lang.Object
net.kyori.indra.git.RepositoryValueSource<V,P>
net.kyori.indra.git.MappedRepositoryValueSource<I,V,P>
- Type Parameters:
I- the intermediary (non-serializable/config-cacheable) value typeV- the mapped value typeP- the parameters type
- All Implemented Interfaces:
org.gradle.api.provider.ValueSource<V,P>
- Direct Known Subclasses:
MappedRepositoryValueSource.Parameterless
public abstract class MappedRepositoryValueSource<I,V,P extends RepositoryValueSource.Parameters>
extends RepositoryValueSource<V,P>
A
RepositoryValueSource that maps an intermediary value type to a final value type.- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAMappedRepositoryValueSourcethat does not require any additional parameters.Nested classes/interfaces inherited from class net.kyori.indra.git.RepositoryValueSource
RepositoryValueSource.Parameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract IgetRawValue(@NotNull org.eclipse.jgit.api.Git repository) Obtains the raw value from the repository.protected abstract VMaps the raw value to the final value type.protected final Vobtain(@NotNull org.eclipse.jgit.api.Git repository) Methods inherited from class net.kyori.indra.git.RepositoryValueSource
obtainMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.provider.ValueSource
getParameters
-
Constructor Details
-
MappedRepositoryValueSource
public MappedRepositoryValueSource()
-
-
Method Details
-
obtain
- Specified by:
obtainin classRepositoryValueSource<V,P extends RepositoryValueSource.Parameters>
-
getRawValue
Obtains the raw value from the repository.- Parameters:
repository- the git repository- Returns:
- the raw value, or
null
-
mapValue
@Nullable protected abstract V mapValue(@NotNull @NotNull org.eclipse.jgit.api.Git git, @NotNull I value) Maps the raw value to the final value type.- Parameters:
git- the git repositoryvalue- the raw value- Returns:
- the mapped value, or
null
-