@Override Object extract(LongOption holder) { return holder.get(); } });
@Override public long get(Object o) { return ((LongOption) o).get(); } }
/** * Returns selling_price_total. * @return selling_price_total * @throws NullPointerException if selling_price_total is <code>null</code> */ public long getSellingPriceTotal() { return this.sellingPriceTotal.get(); } /**
/** * Returns amount_total. * @return amount_total * @throws NullPointerException if amount_total is <code>null</code> */ public long getAmountTotal() { return this.amountTotal.get(); } /**
@Override protected Number get(LongOption property) { return property.get(); }
@Override protected void doEmitDefault(LongOption property, StringBuilder output) { output.append(property.get()); }
@Override public Object getPrimitiveJavaObject(Object o) { LongOption object = (LongOption) o; if (object == null || object.isNull()) { return null; } return object.get(); }
@Override public Object getPrimitiveWritableObject(Object o) { LongOption object = (LongOption) o; if (object == null || object.isNull()) { return null; } return new LongWritable(object.get()); }
@Override public void write(Object value, RecordConsumer consumer) { consumer.addLong(((LongOption) value).get()); } },
@Override protected void doWrite(LongOption property, ValueWriter writer) throws IOException { writer.writeLong(property.get()); }
@Override public void emit(LongOption option) throws IOException { startCell(); if (emitNull(option)) { return; } lineBuffer.append(option.get()); }
/** * test for get. */ @Test public void get() { LongOption option = new LongOption(); option.modify(100); assertThat(option.get(), is(100L)); assertThat(option.isNull(), is(false)); }
assertThat(option.get(), is((long) 0)); assertThat(option.get(), is((long) 1)); assertThat(option.get(), is((long) 50)); assertThat(option.get(), is((long) -1)); assertThat(option.get(), is((long) -50)); assertThat(option.get(), is(Long.MAX_VALUE)); assertThat(option.get(), is(Long.MIN_VALUE)); assertThat(option.get(), is((long) 0)); assertThat(option.get(), is((long) 0));
/** * test for parsing {@code long} value. * @throws Exception if failed */ @Test public void fillLong() throws Exception { LongOption value = new LongOption(); create("long"); assertThat(parser.next(), is(true)); parser.fill(value); assertThat(value.get(), is(0L)); parser.fill(value); assertThat(value.get(), is(10L)); parser.fill(value); assertThat(value.get(), is(-10L)); parser.endRecord(); assertThat(parser.next(), is(true)); parser.fill(value); assertThat(value.isNull(), is(true)); parser.fill(value); assertThat(value.get(), is(Long.MAX_VALUE)); parser.fill(value); assertThat(value.get(), is(Long.MIN_VALUE)); parser.endRecord(); assertThat(parser.next(), is(false)); }
assertThat(parser.next(), is(true)); parser.fill(value); assertThat(value.get(), is(0L)); parser.fill(value); assertThat(value.get(), is(10L)); parser.fill(value); assertThat(value.get(), is(-10L)); assertThat(value.isNull(), is(true)); parser.fill(value); assertThat(value.get(), is(Long.MAX_VALUE)); parser.fill(value); assertThat(value.get(), is(Long.MIN_VALUE));