@Test public void read() throws Exception { final Distance distance = new DistanceBuilderFactory(ID) .setUuid(DIST_UUID) .setTrip(mTrip) .setLocation(LOCATION) .setDistance(DISTANCE) .setDate(DATE) .setTimezone(TIMEZONE) .setRate(RATE) .setCurrency(CURRENCY_CODE) .setComment(COMMENT) .setSyncState(mSyncState) .setPaymentMethod(PAYMENT_METHOD) .setLocationHiddenFromAutoComplete(LOCATION_HIDDEN_FROM_AUTO_COMPLETE) .setCommentHiddenFromAutoComplete(COMMENT_HIDDEN_FROM_AUTO_COMPLETE) .build(); assertEquals(distance, mDistanceDatabaseAdapter.read(mCursor)); }
@NonNull @Override public Distance read(@NonNull Cursor cursor) { final int parentIndex = cursor.getColumnIndex(ReceiptsTable.COLUMN_PARENT_TRIP_ID); final Trip trip = mTripsTable.findByPrimaryKey(cursor.getInt(parentIndex)).blockingGet(); return readForSelection(cursor, trip, true); }
DistanceDatabaseAdapter implements SelectionBackedDatabaseAdapter<Distance, Trip> { @NonNull @Override public Distance read(@NonNull Cursor cursor) { final int parentIndex = cursor.getColumnIndex(ReceiptsTable.COLUMN_PARENT_TRIP_ID); final Trip trip = mTripsTable.findByPrimaryKey(cursor.getInt(parentIndex)).blockingGet(); return readForSelection(cursor, trip, true); } }
DistanceDatabaseAdapter implements SelectionBackedDatabaseAdapter<Distance, Trip> { @NonNull @Override public Distance read(@NonNull Cursor cursor) { final int parentIndex = cursor.getColumnIndex(ReceiptsTable.COLUMN_PARENT_TRIP_ID); final Trip trip = mTripsTable.findByPrimaryKey(cursor.getInt(parentIndex)).blockingGet(); return readForSelection(cursor, trip, true); } DistanceDatabaseAdapter(@NonNull Table<Trip> tripsTable, @NonNull Table<PaymentMethod> paymentMethodTable);  DistanceDatabaseAdapter(@NonNull Table<Trip> tripsTable, @NonNull Table<PaymentMethod> paymentMethodTable,
                                   @NonNull SyncStateAdapter syncStateAdapter); }
DistanceDatabaseAdapter implements SelectionBackedDatabaseAdapter<Distance, Trip> { @NonNull @Override public Distance read(@NonNull Cursor cursor) { final int parentIndex = cursor.getColumnIndex(ReceiptsTable.COLUMN_PARENT_TRIP_ID); final Trip trip = mTripsTable.findByPrimaryKey(cursor.getInt(parentIndex)).blockingGet(); return readForSelection(cursor, trip, true); } DistanceDatabaseAdapter(@NonNull Table<Trip> tripsTable, @NonNull Table<PaymentMethod> paymentMethodTable);  DistanceDatabaseAdapter(@NonNull Table<Trip> tripsTable, @NonNull Table<PaymentMethod> paymentMethodTable,
                                   @NonNull SyncStateAdapter syncStateAdapter); @NonNull @Override Distance read(@NonNull Cursor cursor); @NonNull @Override Distance readForSelection(@NonNull Cursor cursor, @NonNull Trip trip, boolean isDescending); @NonNull @Override ContentValues write(@NonNull Distance distance, @NonNull DatabaseOperationMetadata databaseOperationMetadata); @NonNull @Override Distance build(@NonNull Distance distance, int primaryKey, @NonNull UUID uuid,
                          @NonNull DatabaseOperationMetadata databaseOperationMetadata); }
DistanceDatabaseAdapter implements SelectionBackedDatabaseAdapter<Distance, Trip> { @NonNull @Override public Distance read(@NonNull Cursor cursor) { final int parentIndex = cursor.getColumnIndex(ReceiptsTable.COLUMN_PARENT_TRIP_ID); final Trip trip = mTripsTable.findByPrimaryKey(cursor.getInt(parentIndex)).blockingGet(); return readForSelection(cursor, trip, true); } DistanceDatabaseAdapter(@NonNull Table<Trip> tripsTable, @NonNull Table<PaymentMethod> paymentMethodTable);  DistanceDatabaseAdapter(@NonNull Table<Trip> tripsTable, @NonNull Table<PaymentMethod> paymentMethodTable,
                                   @NonNull SyncStateAdapter syncStateAdapter); @NonNull @Override Distance read(@NonNull Cursor cursor); @NonNull @Override Distance readForSelection(@NonNull Cursor cursor, @NonNull Trip trip, boolean isDescending); @NonNull @Override ContentValues write(@NonNull Distance distance, @NonNull DatabaseOperationMetadata databaseOperationMetadata); @NonNull @Override Distance build(@NonNull Distance distance, int primaryKey, @NonNull UUID uuid,
                          @NonNull DatabaseOperationMetadata databaseOperationMetadata);  }