Class ExplicitBuildTargetSourcePath
- java.lang.Object
-
- com.facebook.buck.core.sourcepath.ExplicitBuildTargetSourcePath
-
- All Implemented Interfaces:
BuildTargetSourcePath
,SourcePath
,Comparable<SourcePath>
public abstract class ExplicitBuildTargetSourcePath extends Object implements BuildTargetSourcePath
ABuildTargetSourcePath
which resolves to a specific (possibly non-default) output of theBuildRule
referred to by its target.
-
-
Constructor Summary
Constructors Constructor Description ExplicitBuildTargetSourcePath()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(SourcePath other)
boolean
equals(Object other)
abstract Optional<com.google.common.hash.HashCode>
getPrecomputedHash()
In rare cases, a BuildTargetSourcePath may know a hash of its content on disk before it even creates its output.abstract Path
getResolvedPath()
abstract BuildTargetWithOutputs
getTargetWithOutputs()
int
hashCode()
static ExplicitBuildTargetSourcePath
of(BuildTarget target, Path resolvedPath)
Construct a new immutableExplicitBuildTargetSourcePath
instance.static ExplicitBuildTargetSourcePath
of(BuildTargetWithOutputs target, Path resolvedPath)
Construct a new immutableExplicitBuildTargetSourcePath
instance.static ExplicitBuildTargetSourcePath
of(BuildTargetWithOutputs targetWithOutputs, Path resolvedPath, Optional<? extends com.google.common.hash.HashCode> precomputedHash)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.facebook.buck.core.sourcepath.BuildTargetSourcePath
getTarget, representationForRuleKey
-
Methods inherited from interface com.facebook.buck.core.sourcepath.SourcePath
compareClasses
-
-
-
-
Method Detail
-
of
public static ExplicitBuildTargetSourcePath of(BuildTarget target, Path resolvedPath)
Construct a new immutableExplicitBuildTargetSourcePath
instance.- Parameters:
target
- The value for thetarget
attributeresolvedPath
- The value for theresolvedPath
attribute- Returns:
- An immutable ExplicitBuildTargetSourcePath instance pointing to the given target's default outputs
-
of
public static ExplicitBuildTargetSourcePath of(BuildTargetWithOutputs target, Path resolvedPath)
Construct a new immutableExplicitBuildTargetSourcePath
instance.- Parameters:
target
- TheBuildTargetWithOutputs
associated with thisSourcePath
resolvedPath
- The value for theresolvedPath
attribute- Returns:
- An immutable ExplicitBuildTargetSourcePath instance pointing to outputs associated with
the given
targetWithOutputs
-
of
public static ExplicitBuildTargetSourcePath of(BuildTargetWithOutputs targetWithOutputs, Path resolvedPath, Optional<? extends com.google.common.hash.HashCode> precomputedHash)
-
getTargetWithOutputs
public abstract BuildTargetWithOutputs getTargetWithOutputs()
- Specified by:
getTargetWithOutputs
in interfaceBuildTargetSourcePath
- Returns:
- the
BuildTargetWithOutputs
thisSourcePath
is associated with
-
getResolvedPath
public abstract Path getResolvedPath()
-
getPrecomputedHash
public abstract Optional<com.google.common.hash.HashCode> getPrecomputedHash()
Description copied from interface:BuildTargetSourcePath
In rare cases, a BuildTargetSourcePath may know a hash of its content on disk before it even creates its output. In this case, we can skip hashing its output files entirely and simply use this precomputed hash code. Use Optional.empty() in the common case.- Specified by:
getPrecomputedHash
in interfaceBuildTargetSourcePath
-
compareTo
public int compareTo(SourcePath other)
- Specified by:
compareTo
in interfaceComparable<SourcePath>
-
-