@Override protected HollowObject getForOrdinal(int ordinal) { return new GenericHollowObject(readStateEngine, type, ordinal); } };
private ObjectModificationValidator<HollowAPI, GenericHollowObject> createValidator( BiPredicate<GenericHollowObject, GenericHollowObject> filter) { return new ObjectModificationValidator<>(TypeA.class.getSimpleName(), filter, HollowAPI::new, (api, ordinal) -> new GenericHollowObject(api.getDataAccess(), TypeA.class.getSimpleName(), ordinal)); } }
public void deltaApplied(HollowAPI api, HollowReadStateEngine stateEngine, long version) throws Exception { deltaOrdinal0Objects.add(new GenericHollowObject(api.getDataAccess(), "Integer", 0)); deltaOrdinal1Objects.add(new GenericHollowObject(api.getDataAccess(), "Integer", 1)); } };
@Override protected Float getData(HollowObjectTypeReadState readState, int ordinal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); return obj.getFloat("value"); }
@Override protected Long getData(HollowObjectTypeReadState readState, int ordinal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); return obj.getLong("value"); }
@Override protected Double getData(HollowObjectTypeReadState readState, int ordinal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); return obj.getDouble("value"); }
private void assertTypeA(HollowPrimaryKeyIndex typeAIdx, int id1, String id2, Long expectedValue) { int ordinal = typeAIdx.getMatchingOrdinal(id1, id2); if (expectedValue == null) { Assert.assertEquals(-1, ordinal); } else { Assert.assertNotEquals(-1, ordinal); GenericHollowObject obj = new GenericHollowObject( typeAIdx.getTypeState(), ordinal); Assert.assertEquals(expectedValue.longValue(), obj.getLong("value")); } }
@Test public void testDate() throws IOException { HollowObjectMapper mapper = new HollowObjectMapper(writeStateEngine); long time = System.currentTimeMillis(); mapper.add(new Date(time)); roundTripSnapshot(); int theOrdinal = readStateEngine.getTypeState("Date").maxOrdinal(); GenericHollowObject obj = new GenericHollowObject(readStateEngine, "Date", theOrdinal); Assert.assertEquals(time, obj.getLong("value")); }
private void assertTypeB(int ordinal, int b1) { HollowObjectTypeReadState typeState = (HollowObjectTypeReadState) readStateEngine.getTypeState("TypeB"); GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(typeState), ordinal); Assert.assertEquals(b1, obj.getInt("b1")); }
private void assertTypeB(int ordinal, int b1) { HollowObjectTypeReadState typeState = (HollowObjectTypeReadState) readStateEngine.getTypeState("TypeB"); GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(typeState), ordinal); Assert.assertEquals(b1, obj.getInt("b1")); }
private void assertObject(HollowObjectTypeReadState readState, int ordinal, int intVal, String strVal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); Assert.assertEquals(intVal, obj.getInt("f1")); Assert.assertEquals(strVal, obj.getString("f2")); }
private void assertObject(HollowObjectTypeReadState readState, int ordinal, int intVal, String strVal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); Assert.assertEquals(intVal, obj.getInt("f1")); Assert.assertEquals(strVal, obj.getString("f2")); }
private void assertObject(HollowObjectTypeReadState readState, int ordinal, int intVal, String strVal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); Assert.assertEquals(intVal, obj.getInt("f1")); Assert.assertEquals(strVal, obj.getString("f2")); }
private void assertObject(HollowObjectTypeReadState readState, int ordinal, int intVal, String strVal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); Assert.assertEquals(intVal, obj.getInt("f1")); Assert.assertEquals(strVal, obj.getString("f2")); }
private void assertObject(HollowObjectTypeReadState readState, int ordinal, int intVal, String strVal) { GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(readState), ordinal); Assert.assertEquals(intVal, obj.getInt("f1")); Assert.assertEquals(strVal, obj.getString("f2")); }
private void assertTypeA(int ordinal, boolean a1, String a2) { HollowObjectTypeReadState typeState = (HollowObjectTypeReadState)readStateEngine.getTypeState("TypeA"); GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(typeState), ordinal); Assert.assertEquals(a1, obj.getBoolean("a1")); Assert.assertEquals(a2, obj.getString("a2")); }
private void assertTypeA(int ordinal, int a1, int bOrdinal) { HollowObjectTypeReadState typeState = (HollowObjectTypeReadState) readStateEngine.getTypeState("TypeA"); GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(typeState), ordinal); Assert.assertEquals(a1, obj.getInt("a1")); Assert.assertEquals(bOrdinal, obj.getOrdinal("a2")); }
private void assertTypeB(int ordinal, int b1, boolean b2) { HollowObjectTypeReadState typeState = (HollowObjectTypeReadState) readStateEngine.getTypeState("TypeB"); GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(typeState), ordinal); Assert.assertEquals(b1, obj.getInt("b1")); Assert.assertEquals(b2, obj.getBoolean("b2")); }
private void assertObject(int ordinal, long l, int i, double d) { HollowObjectTypeReadState typeState = (HollowObjectTypeReadState) readStateEngine.getTypeState("TestObject"); GenericHollowObject obj = new GenericHollowObject(new HollowObjectGenericDelegate(typeState), ordinal); Assert.assertEquals(l, obj.getLong("longField")); Assert.assertEquals(i, obj.getInt("intField")); Assert.assertTrue(d == obj.getDouble("doubleField")); }
private void assertTypeAWithTypeC(int ordinal, boolean a1, String a2, String c1) { HollowObjectTypeReadState typeAState = (HollowObjectTypeReadState)readStateEngine.getTypeState("TypeA"); GenericHollowObject typeAObj = new GenericHollowObject(new HollowObjectGenericDelegate(typeAState), ordinal); Assert.assertEquals(a1, typeAObj.getBoolean("a1")); Assert.assertEquals(a2, typeAObj.getString("a2")); GenericHollowObject typeCObj = (GenericHollowObject) typeAObj.getReferencedGenericRecord("a4"); Assert.assertEquals(c1, typeCObj.getString("c1")); }