@Override public final void addBinary(Binary value) { try { ProtobufDatumFactory factory = ProtobufDatumFactory.get(dataType.getCode()); Message.Builder builder = factory.newBuilder(); builder.mergeFrom(value.getBytes()); parent.add(factory.createDatum(builder)); } catch (InvalidProtocolBufferException e) { throw new RuntimeException(e); } }
@Override public final void addBinary(Binary value) { parent.add(new BlobDatum(ByteBuffer.wrap(value.getBytes()))); }
@Override public final void addDouble(double value) { parent.add(DatumFactory.createFloat8(value)); }
@Override public final void addBinary(Binary value) { parent.add(DatumFactory.createText(value.getBytes())); }
@Override public final void addLong(long value) { parent.add(DatumFactory.createFloat4(Float.valueOf(value))); }
@Override public final void addFloat(float value) { parent.add(DatumFactory.createFloat8(Double.valueOf(value))); }
@Override public final void addInt(int value) { parent.add(DatumFactory.createInt8(Long.valueOf(value))); }
@Override public final void addLong(long value) { parent.add(DatumFactory.createInt8(value)); }
@Override public final void addInt(int value) { parent.add(DatumFactory.createInt2((short) value)); }
@Override public final void addInt(int value) { parent.add(DatumFactory.createBit((byte) (value & 0xff))); }
@Override public final void addBoolean(boolean value) { parent.add(DatumFactory.createBool(value)); }