private Collection<AttributeUpdate> createAttributeUpdates(int count) { Collection<AttributeUpdate> result = new ArrayList<>(count); for (int i = 0; i < count; i++) { boolean isCore = i % 2 == 0; UUID id = isCore ? new UUID(Long.MIN_VALUE, i) : UUID.randomUUID(); AttributeUpdateType ut = AttributeUpdateType.values()[i % AttributeUpdateType.values().length]; result.add(new AttributeUpdate(id, ut, i, i)); } return result; }
private AttributeUpdate readAttributeUpdate00(RevisionDataInput source) throws IOException { return new AttributeUpdate( source.readUUID(), AttributeUpdateType.get(source.readByte()), source.readLong(), source.readLong()); } }
private void writeAttributeUpdate00(RevisionDataOutput target, AttributeUpdate au) throws IOException { target.writeUUID(au.getAttributeId()); target.writeByte(au.getUpdateType().getTypeId()); target.writeLong(au.getValue()); target.writeLong(au.getComparisonValue()); }
private AttributeUpdate readAttributeUpdate00(RevisionDataInput source) throws IOException { return new AttributeUpdate( source.readUUID(), AttributeUpdateType.get(source.readByte()), source.readLong(), source.readLong()); } }
private void writeAttributeUpdate00(RevisionDataOutput target, AttributeUpdate au) throws IOException { target.writeUUID(au.getAttributeId()); target.writeByte(au.getUpdateType().getTypeId()); target.writeLong(au.getValue()); target.writeLong(au.getComparisonValue()); }
static Collection<AttributeUpdate> createAttributes() { val result = new ArrayList<AttributeUpdate>(); long currentValue = 0; for (AttributeUpdateType ut : AttributeUpdateType.values()) { result.add(new AttributeUpdate(UUID.randomUUID(), ut, ++currentValue, currentValue)); } return result; } }