blob: ab1ae28d885b8626dcc8366f9120309b929fbfd2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.slime;
/**
* Helper class for inserting values into an ArrayValue.
* For justification read Inserter documentation.
**/
final class ArrayInserter implements Inserter {
private Cursor target;
public final ArrayInserter adjust(Cursor c) {
target = c;
return this;
}
public final Cursor insertNIX() { return target.addNix(); }
public final Cursor insertBOOL(boolean value) { return target.addBool(value); }
public final Cursor insertLONG(long value) { return target.addLong(value); }
public final Cursor insertDOUBLE(double value) { return target.addDouble(value); }
public final Cursor insertSTRING(String value) { return target.addString(value); }
public final Cursor insertSTRING(byte[] utf8) { return target.addString(utf8); }
public final Cursor insertDATA(byte[] value) { return target.addData(value); }
public final Cursor insertARRAY() { return target.addArray(); }
public final Cursor insertOBJECT() { return target.addObject(); }
}
|