@Test public void testWriteAndReadFields() throws Exception { PropertyValueList p1 = PropertyValueList.fromPropertyValues( Lists.newArrayList( PropertyValue.create(GradoopTestUtils.NULL_VAL_0), PropertyValue.create(GradoopTestUtils.BOOL_VAL_1), PropertyValue.create(GradoopTestUtils.INT_VAL_2), PropertyValue.create(GradoopTestUtils.LONG_VAL_3), PropertyValue.create(GradoopTestUtils.FLOAT_VAL_4), PropertyValue.create(GradoopTestUtils.DOUBLE_VAL_5), PropertyValue.create(GradoopTestUtils.STRING_VAL_6), PropertyValue.create(GradoopTestUtils.BIG_DECIMAL_VAL_7) ) ); PropertyValueList p2 = writeAndReadFields(PropertyValueList.class, p1); assertEquals(p1, p2); }
public static PropertyValueList fromPropertyValues( Collection<PropertyValue> propertyValues) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(byteStream); DataOutputView outputView = new DataOutputViewStreamWrapper(outputStream); for (PropertyValue propertyValue : propertyValues) { propertyValue.write(outputView); } outputStream.flush(); return new PropertyValueList(byteStream.toByteArray()); }
PropertyValueList implements Iterable<PropertyValue>, Serializable, Value, Comparable<PropertyValueList> { public static PropertyValueList fromPropertyValues( Collection<PropertyValue> propertyValues) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(byteStream); DataOutputView outputView = new DataOutputViewStreamWrapper(outputStream); for (PropertyValue propertyValue : propertyValues) { propertyValue.write(outputView); } outputStream.flush(); return new PropertyValueList(byteStream.toByteArray()); } }
PropertyValueList implements Iterable<PropertyValue>, Serializable, Value, Comparable<PropertyValueList> { public static PropertyValueList fromPropertyValues( Collection<PropertyValue> propertyValues) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(byteStream); DataOutputView outputView = new DataOutputViewStreamWrapper(outputStream); for (PropertyValue propertyValue : propertyValues) { propertyValue.write(outputView); } outputStream.flush(); return new PropertyValueList(byteStream.toByteArray()); } PropertyValueList(); private  PropertyValueList(byte[] bytes); }
PropertyValueList implements Iterable<PropertyValue>, Serializable, Value, Comparable<PropertyValueList> { public static PropertyValueList fromPropertyValues( Collection<PropertyValue> propertyValues) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(byteStream); DataOutputView outputView = new DataOutputViewStreamWrapper(outputStream); for (PropertyValue propertyValue : propertyValues) { propertyValue.write(outputView); } outputStream.flush(); return new PropertyValueList(byteStream.toByteArray()); } PropertyValueList(); private  PropertyValueList(byte[] bytes); static PropertyValueList createEmptyList(); static PropertyValueList fromPropertyValues(
    Collection<PropertyValue> propertyValues); @Override boolean equals(Object o); @Override int hashCode(); @Override Iterator<PropertyValue> iterator(); @Override void write(DataOutputView dataOutput); @Override void read(DataInputView dataInput); @Override int compareTo(PropertyValueList o); @Override String toString(); }
PropertyValueList implements Iterable<PropertyValue>, Serializable, Value, Comparable<PropertyValueList> { public static PropertyValueList fromPropertyValues( Collection<PropertyValue> propertyValues) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(byteStream); DataOutputView outputView = new DataOutputViewStreamWrapper(outputStream); for (PropertyValue propertyValue : propertyValues) { propertyValue.write(outputView); } outputStream.flush(); return new PropertyValueList(byteStream.toByteArray()); } PropertyValueList(); private  PropertyValueList(byte[] bytes); static PropertyValueList createEmptyList(); static PropertyValueList fromPropertyValues(
    Collection<PropertyValue> propertyValues); @Override boolean equals(Object o); @Override int hashCode(); @Override Iterator<PropertyValue> iterator(); @Override void write(DataOutputView dataOutput); @Override void read(DataInputView dataInput); @Override int compareTo(PropertyValueList o); @Override String toString();  }