APISonar


com.zendesk.maxwell.row.RawJSONString.json

> com > zendesk > maxwell > row > RawJSONString > json
com APIs zendesk APIs maxwell APIs row APIs RawJSONString APIs json APIs

Example 1
public void TestEmptyJSON() {
		byte input[] = new byte[0];

		ColumnDef d = ColumnDef.build("bar", "ascii", "json", (short) 1, false, null, null);

		RawJSONString result = (RawJSONString) d.asJSON(input, null);
		assertThat(result.json, is("null"));
	}
Example 2
public void TestJSON() {
		byte input[] = new byte[] { (byte) 0, (byte) 1, (byte) 0, (byte) 13, (byte) 0, (byte) 11,
				(byte) 0, (byte) 2, (byte) 0, (byte) 5, (byte) 3, (byte) 0, (byte) 105, (byte) 100 };

		ColumnDef d = ColumnDef.build("bar", "ascii", "json", (short) 1, false, null, null);

		RawJSONString result = (RawJSONString) d.asJSON(input, null);
		assertThat(result.json, is("{\"id\":3}"));
	}