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 type
V - the mapped value type
P - 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
  • Constructor Details

    • MappedRepositoryValueSource

      public MappedRepositoryValueSource()
  • Method Details

    • obtain

      @Nullable protected final V obtain(@NotNull @NotNull org.eclipse.jgit.api.Git repository)
      Specified by:
      obtain in class RepositoryValueSource<V,P extends RepositoryValueSource.Parameters>
    • getRawValue

      @Nullable protected abstract I getRawValue(@NotNull @NotNull org.eclipse.jgit.api.Git repository)
      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 repository
      value - the raw value
      Returns:
      the mapped value, or null