@Override public <A extends Appendable> A appendTo(StructuredReader activeReader, long id, A target) { try { if (activeReader.readBoolean(id)) { target.append("true"); } else { target.append("false"); } } catch (IOException e) { throw new RuntimeException(e); } return target; }
@Override public <A extends Appendable> A appendTo(StructuredReader activeReader, long id, A target) { try { if (activeReader.readBoolean(id)) { target.append("true"); } else { target.append("false"); } } catch (IOException e) { throw new RuntimeException(e); } return target; }
public boolean productUpdate(HTTPRequestReader request) { StructuredReader structured = request.structured(); int idx = structured.readInt(Field.ID); quantity[idx] = structured.readInt(Field.QUANTITY); disabled[idx] = structured.readBoolean(Field.DISABLED); names[idx].setLength(0); structured.readText(Field.NAME, names[idx] ); return responseService.publishHTTPResponse(request, 200); }
/** * Reads boolean from specified field in pipe * @param association field association showing where to read * @return <code>false</code> when absent, else <code>true</code> */ public boolean readBoolean(Object association) { return readBoolean(Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldLookupByIdentity(association, DataInputBlobReader.getStructType(channelReader))); }
/** * Reads boolean from specified field in pipe * @param association field association showing where to read * @return <code>false</code> when absent, else <code>true</code> */ public boolean readBoolean(Object association) { return readBoolean(Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldLookupByIdentity(association, DataInputBlobReader.getStructType(channelReader))); }
/** * Reads boolean from specified field in pipe * @param association field association showing where to read * @return <code>false</code> when absent, else <code>true</code> */ public boolean readBoolean(Object association) { return readBoolean(Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldLookupByIdentity(association, DataInputBlobReader.getStructType(channelReader))); }
id = struct.readInt(Field.ID); quantity = struct.readInt(Field.QUANTITY); disabled = struct.readBoolean(Field.DISABLED); name = struct.readText(Field.NAME); break;
public boolean productUpdate(HTTPRequestReader request) { StructuredReader source = request.structured(); return publishService.publishTopic((w)->{ //write update message with new payload plus sequence and connectionID StructuredWriter target = w.structured(); target.writeInt(Field.ID, source.readInt(Field.ID)); target.writeInt(Field.QUANTITY, source.readInt(Field.QUANTITY)); target.writeBoolean(Field.DISABLED, source.readBoolean(Field.DISABLED)); //source.readText(Field.NAME, target.writeText(Field.NAME)); //Broken?? target.writeText(Field.NAME, source.readText(Field.NAME)); target.writeLong(Field.CONNECTION, request.getConnectionId()); target.writeLong(Field.SEQUENCE, request.getSequenceCode()); target.selectStruct(Struct.DB_PRODUCT_UPDATE); }); }