Package io.bytestreams.codec.iso8583
Class BitmappedCodecBuilder<T extends Bitmapped>
java.lang.Object
io.bytestreams.codec.iso8583.BitmappedCodecBuilder<T>
- Type Parameters:
T- the bitmapped object type
A two-phase builder for constructing an
SequentialObjectCodec over a Bitmapped
object.
Phase 1 (BitmappedCodecBuilder): add non-optional fields and then the bitmap field.
Phase 2 (DataFieldBuilder): add bitmap-driven data fields and build.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPhase 2 builder for adding bitmap-driven data fields usingBitmappedFieldSpec. -
Method Summary
Modifier and TypeMethodDescription<B extends Bitmap>
BitmappedCodecBuilder.DataFieldBuilder<T> Adds the bitmap field and transitions to the data field phase.static <T extends Bitmapped>
BitmappedCodecBuilder<T> Creates a new builder.<V> BitmappedCodecBuilder<T> Adds a non-optional field before the bitmap.
-
Method Details
-
builder
Creates a new builder.- Type Parameters:
T- the bitmapped object type- Parameters:
factory- supplier that creates new instances during decoding- Returns:
- a new builder
-
field
Adds a non-optional field before the bitmap.- Type Parameters:
V- the field value type- Parameters:
spec- the field specification- Returns:
- this builder
-
bitmap
public <B extends Bitmap> BitmappedCodecBuilder.DataFieldBuilder<T> bitmap(io.bytestreams.codec.core.FieldSpec<T, B> spec) Adds the bitmap field and transitions to the data field phase.- Type Parameters:
B- the bitmap type- Parameters:
spec- the bitmap field specification- Returns:
- a
BitmappedCodecBuilder.DataFieldBuilderfor adding data fields
-