resolvedSpec.setOutputFn(getOutputFn());
/** * Like {@link #via(Contextful, Contextful)}, but the output type of the sink is the same as the * type of the input collection. The sink function must create a new {@link Sink} instance every * time it is called. */ public Write<DestinationT, UserT> via(Contextful<Fn<DestinationT, Sink<UserT>>> sinkFn) { checkArgument(sinkFn != null, "sinkFn can not be null"); return toBuilder() .setSinkFn((Contextful) sinkFn) .setOutputFn(fn(SerializableFunctions.<UserT>identity())) .build(); }
/** * Specifies how to create a {@link Sink} for a particular destination and how to map the * element type to the sink's output type. The sink function must create a new {@link Sink} * instance every time it is called. */ public <OutputT> Write<DestinationT, UserT> via( Contextful<Fn<UserT, OutputT>> outputFn, Contextful<Fn<DestinationT, Sink<OutputT>>> sinkFn) { checkArgument(sinkFn != null, "sinkFn can not be null"); checkArgument(outputFn != null, "outputFn can not be null"); return toBuilder().setSinkFn((Contextful) sinkFn).setOutputFn(outputFn).build(); }