/** * Convert DeleteAction to DeleteActionProto. * * @param action * @return */ public static DeleteActionProto convert(DeleteAction action) { DeleteActionProto.Builder builder = DeleteActionProto.newBuilder(); builder.setTableName(action.getFTableName()); builder.setPrimayKey(ByteString.copyFrom(action.getCombinedPrimaryKey())); return builder.build(); }
/** * convert DeleteActionProto to DeleteAction. * * @param proto * @return */ public static DeleteAction convert(DeleteActionProto deleteActionProto) { return new DeleteAction( deleteActionProto.getTableName(), deleteActionProto.getPrimayKey().toByteArray()); }