public abstract class TargetNodeTranslator extends Object
BuildTarget
s in TargetNode
s.
The API methods use an Optional
for their return types, so that Optional.empty()
can be used to signify a translation was not needed. This may allow some translation functions to
avoid copying or creating unnecessary new objects.Constructor and Description |
---|
TargetNodeTranslator(TypeCoercerFactory typeCoercerFactory,
com.google.common.collect.ImmutableList<com.facebook.buck.versions.TargetTranslator<?>> translators,
Cells cells) |
Modifier and Type | Method and Description |
---|---|
abstract Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> |
getSelectedVersions(BuildTarget target) |
<A> Optional<A> |
translate(CellNameResolver cellNameResolver,
BaseName targetBaseName,
A object) |
abstract Optional<BuildTarget> |
translateBuildTarget(BuildTarget target) |
<A extends ConstructorArg> |
translateNode(TargetNode<A> node) |
public TargetNodeTranslator(TypeCoercerFactory typeCoercerFactory, com.google.common.collect.ImmutableList<com.facebook.buck.versions.TargetTranslator<?>> translators, Cells cells)
public abstract Optional<BuildTarget> translateBuildTarget(BuildTarget target)
public abstract Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> getSelectedVersions(BuildTarget target)
public <A> Optional<A> translate(CellNameResolver cellNameResolver, BaseName targetBaseName, A object)
public <A extends ConstructorArg> Optional<TargetNode<A>> translateNode(TargetNode<A> node)
TargetNode
with all found BuildTarget
s translated,
or Optional.empty()
if the node requires no translation.