public abstract class SourceArtifactImpl extends Object implements SourceArtifact, BoundArtifact
Constructor and Description |
---|
SourceArtifactImpl() |
Modifier and Type | Method and Description |
---|---|
BoundArtifact |
asBound() |
BuildArtifact |
asBuildArtifact() |
com.facebook.buck.core.artifact.DeclaredArtifact |
asDeclared() |
OutputArtifact |
asOutputArtifact() |
SkylarkOutputArtifactApi |
asSkylarkOutputArtifact(com.google.devtools.build.lib.events.Location location) |
SourceArtifact |
asSource() |
int |
compareTo(Artifact artifact) |
String |
getBasename() |
String |
getExtension() |
Object |
getOwner() |
Optional<com.google.devtools.build.lib.cmdline.Label> |
getOwnerTyped() |
String |
getShortPath() |
abstract PathSourcePath |
getSourcePath() |
boolean |
isBound() |
boolean |
isSource() |
static SourceArtifactImpl |
of(PathSourcePath sourcePath) |
void |
repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer) |
protected void |
requireBound() |
protected void |
requireDeclared() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asBound, asDeclared
getOwner, isImmutable
isHashable
debugPrint, str
compareTo
public final boolean isBound()
public abstract PathSourcePath getSourcePath()
getSourcePath
in interface BoundArtifact
getSourcePath
in interface SourceArtifact
@Nullable public SourceArtifact asSource()
asSource
in interface BoundArtifact
SourceArtifact
, null if this is not a SourceArtifact
@Nullable public BuildArtifact asBuildArtifact()
asBuildArtifact
in interface BoundArtifact
BuildArtifact
, null if this is not a BuildArtifact
@Value.Lazy public String getBasename()
getBasename
in interface SkylarkArtifactApi
@Value.Lazy public String getExtension()
getExtension
in interface SkylarkArtifactApi
@Value.Lazy public Optional<com.google.devtools.build.lib.cmdline.Label> getOwnerTyped()
Optional.empty()
if not
applicable. This is converted to a Skylark appropriate type by getOwner()
@Value.Lazy public boolean isSource()
isSource
in interface SkylarkArtifactApi
@Value.Lazy public String getShortPath()
getShortPath
in interface SkylarkArtifactApi
public void repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer)
repr
in interface com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable
public SkylarkOutputArtifactApi asSkylarkOutputArtifact(com.google.devtools.build.lib.events.Location location) throws com.google.devtools.build.lib.syntax.EvalException
asSkylarkOutputArtifact
in interface SkylarkArtifactApi
com.google.devtools.build.lib.syntax.EvalException
public OutputArtifact asOutputArtifact()
asOutputArtifact
in interface Artifact
OutputArtifact
. Throws if cannot be convertedpublic static SourceArtifactImpl of(PathSourcePath sourcePath)
public final BoundArtifact asBound()
asBound
in interface Artifact
BoundArtifact
public final com.facebook.buck.core.artifact.DeclaredArtifact asDeclared()
asDeclared
in interface Artifact
DeclaredArtifact
protected void requireBound()
protected void requireDeclared()
public final Object getOwner()
getOwner
in interface SkylarkArtifactApi
public final int compareTo(Artifact artifact)
compareTo
in interface Comparable<Artifact>