S
- exposed-typeT
- internal-typepublic class GeneratorBridge<S,T> extends Object implements Generator<S>
Generator<T>
as if it was an Generator<S>
.Modifier and Type | Method and Description |
---|---|
static <S,T> GeneratorBridge<S,T> |
createOneToMany(Generator<T> generator,
CheckedFunction<S,java.util.stream.Stream<T>,?> bridge)
Creates a bridge that maps ONE-TO-MANY from source to destination (i.e.
|
static <S,T> GeneratorBridge<S,T> |
createOneToOne(Generator<T> generator,
CheckedFunction<S,T,?> bridge)
Creates a bridge that maps ONE-TO-ONE from source to destination (i.e.
|
void |
write(S element,
OutputNameStyle outputNameStyle,
ElementOutputter outputter)
Writes a non-indexable output (an output that isn't part of a collection of other similar
items).
|
void |
writeWithIndex(S element,
String index,
IndexableOutputNameStyle outputNameStyle,
ElementOutputter outputter)
Writes an indexable output (many outputs of the same type, uniquely identified by an index).
|
public static <S,T> GeneratorBridge<S,T> createOneToOne(Generator<T> generator, CheckedFunction<S,T,?> bridge)
S
- source-typeT
- destination-typegenerator
- the generator that accepts the destination typebridge
- maps a source-item to one destination-itempublic static <S,T> GeneratorBridge<S,T> createOneToMany(Generator<T> generator, CheckedFunction<S,java.util.stream.Stream<T>,?> bridge)
S
- source-typeT
- destination-typegenerator
- the generator that accepts the destination typebridge
- maps a source-item to one or more destination-itemspublic void write(S element, OutputNameStyle outputNameStyle, ElementOutputter outputter) throws OutputWriteFailedException
ElementWriter
write
in interface ElementWriter<S>
element
- the element to write.outputNameStyle
- TODOOutputWriteFailedException
public void writeWithIndex(S element, String index, IndexableOutputNameStyle outputNameStyle, ElementOutputter outputter) throws OutputWriteFailedException
ElementWriter
writeWithIndex
in interface ElementWriter<S>
element
- the element to write.index
- TODOOutputWriteFailedException
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.