@Override public void traverse(NeededCoverageSpec object, Traversal traversal) { floatTypeCoercer.traverse(object.getNeededCoverageRatio(), traversal); buildTargetTypeCoercer.traverse(object.getBuildTarget(), traversal); Optional<String> pathName = object.getPathName(); if (pathName.isPresent()) { pathNameTypeCoercer.traverse(pathName.get(), traversal); } }
@Override public boolean traverse(Object object, Traversal traversal) { if (object instanceof Collection) { Collection<?> collection = (Collection<?>) object; if (collection.size() != 2) { return false; } Iterator<?> iterator = collection.iterator(); return firstTypeCoercer.traverse(iterator.next(), traversal) && secondTypeCoercer.traverse(iterator.next(), traversal); } return false; }
@Override public void traverse(C object, Traversal traversal) { traversal.traverse(object); for (T element : object) { elementTypeCoercer.traverse(element, traversal); } }
@Override public void traverse(SourceWithFlags object, Traversal traversal) { sourcePathTypeCoercer.traverse(object.getSourcePath(), traversal); flagsTypeCoercer.traverse(ImmutableList.copyOf(object.getFlags()), traversal); }