public class PatternMatchedCollectionTypeCoercer<T> extends Object implements TypeCoercer<Object,PatternMatchedCollection<T>>
TypeCoercer.Traversal
Constructor and Description |
---|
PatternMatchedCollectionTypeCoercer(TypeCoercer<?,Pattern> patternTypeCoercer,
TypeCoercer<?,T> valueTypeCoercer) |
Modifier and Type | Method and Description |
---|---|
PatternMatchedCollection<T> |
coerce(CellNameResolver cellRoots,
ProjectFilesystem filesystem,
ForwardRelativePath pathRelativeToProjectRoot,
TargetConfiguration targetConfiguration,
TargetConfiguration hostConfiguration,
Object object) |
Object |
coerceToUnconfigured(CellNameResolver cellRoots,
ProjectFilesystem filesystem,
ForwardRelativePath pathRelativeToProjectRoot,
Object object)
Coerce to a value for unconfigured graph.
|
PatternMatchedCollection<T> |
concat(Iterable<PatternMatchedCollection<T>> elements)
Implementation of concatenation for this type.
|
com.google.common.reflect.TypeToken<PatternMatchedCollection<T>> |
getOutputType() |
com.google.common.reflect.TypeToken<Object> |
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,
PatternMatchedCollection<T> 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, supportsConcatenation, unconfiguredToConfiguredCoercionIsIdentity
public PatternMatchedCollectionTypeCoercer(TypeCoercer<?,Pattern> patternTypeCoercer, TypeCoercer<?,T> valueTypeCoercer)
public com.google.common.reflect.TypeToken<PatternMatchedCollection<T>> getOutputType()
getOutputType
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
public com.google.common.reflect.TypeToken<Object> getUnconfiguredType()
getUnconfiguredType
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
public boolean hasElementClass(Class<?>... types)
TypeCoercer
hasElementClass
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
public void traverse(CellNameResolver cellRoots, PatternMatchedCollection<T> 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.
traverse
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
public Object coerceToUnconfigured(CellNameResolver cellRoots, ProjectFilesystem filesystem, ForwardRelativePath pathRelativeToProjectRoot, Object object) throws CoerceFailedException
TypeCoercer
coerceToUnconfigured
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
CoerceFailedException
public PatternMatchedCollection<T> coerce(CellNameResolver cellRoots, ProjectFilesystem filesystem, ForwardRelativePath pathRelativeToProjectRoot, TargetConfiguration targetConfiguration, TargetConfiguration hostConfiguration, Object object) throws CoerceFailedException
coerce
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
CoerceFailedException
- Input object cannot be coerced into the given type.@Nullable public PatternMatchedCollection<T> concat(Iterable<PatternMatchedCollection<T>> elements)
TypeCoercer
null
indicates that concatenation
isn't supported by the type.concat
in interface Concatable<PatternMatchedCollection<T>>
concat
in interface TypeCoercer<Object,PatternMatchedCollection<T>>
null
if concatenation is not
supported for the type