public class PairTypeCoercer<FU,SU,FIRST,SECOND> extends Object implements TypeCoercer<Pair<FU,SU>,Pair<FIRST,SECOND>>
TypeCoercer.Traversal
Constructor and Description |
---|
PairTypeCoercer(TypeCoercer<FU,FIRST> firstTypeCoercer,
TypeCoercer<SU,SECOND> secondTypeCoercer) |
Modifier and Type | Method and Description |
---|---|
Pair<FIRST,SECOND> |
coerce(CellNameResolver cellRoots,
ProjectFilesystem filesystem,
ForwardRelativePath pathRelativeToProjectRoot,
TargetConfiguration targetConfiguration,
TargetConfiguration hostConfiguration,
Pair<FU,SU> object) |
Pair<FU,SU> |
coerceToUnconfigured(CellNameResolver cellRoots,
ProjectFilesystem filesystem,
ForwardRelativePath pathRelativeToProjectRoot,
Object object)
Coerce to a value for unconfigured graph.
|
com.google.common.reflect.TypeToken<Pair<FIRST,SECOND>> |
getOutputType() |
com.google.common.reflect.TypeToken<Pair<FU,SU>> |
getUnconfiguredType() |
boolean |
hasElementClass(Class<?>... types)
Returns whether the leaf nodes of this type coercer outputs value that is an instance of the
given class or its subclasses.
|
void |
traverse(CellNameResolver cellRoots,
Pair<FIRST,SECOND> object,
TypeCoercer.Traversal traversal)
Traverse an object guided by this TypeCoercer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkOutputAssignableTo, checkUnconfiguredAssignableTo, coerceBoth, concat, supportsConcatenation, unconfiguredToConfiguredCoercionIsIdentity
public PairTypeCoercer(TypeCoercer<FU,FIRST> firstTypeCoercer, TypeCoercer<SU,SECOND> secondTypeCoercer)
public com.google.common.reflect.TypeToken<Pair<FIRST,SECOND>> getOutputType()
getOutputType
in interface TypeCoercer<Pair<FU,SU>,Pair<FIRST,SECOND>>
public com.google.common.reflect.TypeToken<Pair<FU,SU>> getUnconfiguredType()
getUnconfiguredType
in interface TypeCoercer<Pair<FU,SU>,Pair<FIRST,SECOND>>
public boolean hasElementClass(Class<?>... types)
TypeCoercer
hasElementClass
in interface TypeCoercer<Pair<FU,SU>,Pair<FIRST,SECOND>>
public void traverse(CellNameResolver cellRoots, Pair<FIRST,SECOND> object, TypeCoercer.Traversal traversal)
TypeCoercer
#{link Traversal#traverse} function will be called once for the object. If the object is a collection or map, it will also recursively traverse all elements of the map.
public Pair<FU,SU> coerceToUnconfigured(CellNameResolver cellRoots, ProjectFilesystem filesystem, ForwardRelativePath pathRelativeToProjectRoot, Object object) throws CoerceFailedException
TypeCoercer
coerceToUnconfigured
in interface TypeCoercer<Pair<FU,SU>,Pair<FIRST,SECOND>>
CoerceFailedException
public Pair<FIRST,SECOND> coerce(CellNameResolver cellRoots, ProjectFilesystem filesystem, ForwardRelativePath pathRelativeToProjectRoot, TargetConfiguration targetConfiguration, TargetConfiguration hostConfiguration, Pair<FU,SU> object) throws CoerceFailedException
coerce
in interface TypeCoercer<Pair<FU,SU>,Pair<FIRST,SECOND>>
CoerceFailedException
- Input object cannot be coerced into the given type.