DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Optional attributes would be passed with var-arg parameters at the end.
| Code Block |
|---|
// simple Simpletype Typescase int apple = simpleFieldWrapper(() -> readBuffer.readUnsignedByte("IntegerEncodinglalala = readOptionalField("lalala", 4), WithByteOrder(ByteOrder.LITTLE_ENDIAN)); dataReaderUnsignedInt( ....), something == true) // ComplexEnum Type Banana banana = simpleFieldWrapper(() -> readBuffer.readUnsignedByte("IntegerEncoding", 4), WithByteOrder(ByteOrder.LITTLE_ENDIAN), WithContext("banana")); // Optional Fields Banana banana = optionalFieldWrapper(() -> readBuffer.readUnsignedByte("IntegerEncoding", 4), (apple > 10), WithByteOrder(ByteOrder.LITTLE_ENDIAN), WithContext("banana")); // Const Fields int coolConst = constFieldWrapper(() -> readBuffer.readUnsignedByte("IntegerEncoding", 4), 0x04, WithByteOrder(ByteOrder.LITTLE_ENDIAN)); ... type case // TODO: magic trick is to use the function pointer of the enum parse static method lalala = readOptionalField("lalala", enumReader(TypeOfHurz::enumForValue, dataReaderUnsignedIntCreatorDingels( ... readBuffer ....)), something == true, withAdditonasdl(), withEncoding(), withFickiciy()) // Complex type case // TODO: magic trick is to use a supplier lambda for the staticParse lalala = readOptionalField("lalala", complexTypeReader(()->TypeOfHurz.staticParseIwas(readBuffer, asdasdasdasd, asdasd), readBuffer), something == true) |
Cleaning up the way params are passed to types
In General we decided to replace the square bracets around the passing of parameters from one type to the other with round bracets. This makes the syntax a bit more similar to normal programming languages.
We also moved the place where params are passed from the end to directly after the complex type name.