@Test public void mapsUsingAllMappers() { ShapeId shapeId = ShapeId.from("ns.foo#id1"); StringShape shape = StringShape.builder() .id(shapeId) .addTrait(new SensitiveTrait()) .addTrait(new DocumentationTrait("docs", SourceLocation.NONE)) .build(); Model model = Model.builder().addShape(shape).build(); ModelTransformer transformer = ModelTransformer.create(); Model result = transformer.mapShapes(model, Arrays.asList( s -> Shape.shapeToBuilder(s).removeTrait("sensitive").build(), s -> Shape.shapeToBuilder(s).removeTrait("documentation").build())); assertThat(result.expectShape(shapeId).getTrait(SensitiveTrait.class), Matchers.is(Optional.empty())); assertThat(result.expectShape(shapeId).getTrait(DocumentationTrait.class), Matchers.is(Optional.empty())); }
MapShapes(Function<Shape, Shape> mapper) { this.mapper = mapper; }
MapShapes { MapShapes(Function<Shape, Shape> mapper) { this.mapper = mapper; } }
MapShapes { MapShapes(Function<Shape, Shape> mapper) { this.mapper = mapper; } MapShapes(Function<Shape, Shape> mapper); }
MapShapes { MapShapes(Function<Shape, Shape> mapper) { this.mapper = mapper; } MapShapes(Function<Shape, Shape> mapper);  }
MapShapes { MapShapes(Function<Shape, Shape> mapper) { this.mapper = mapper; } MapShapes(Function<Shape, Shape> mapper);   }