class TripDatabaseAdapter implements DatabaseAdapter<Trip> {

    @Override
    @NonNull
    public ContentValues write(@NonNull Trip trip, @NonNull DatabaseOperationMetadata databaseOperationMetadata) {
        final ContentValues values = new ContentValues();
        values.put(TripsTable.COLUMN_NAME, trip.getName());
        values.put(TripsTable.COLUMN_FROM, trip.getStartDate().getTime());
        values.put(TripsTable.COLUMN_TO, trip.getEndDate().getTime());
        values.put(TripsTable.COLUMN_FROM_TIMEZONE, trip.getStartTimeZone().getID());
        values.put(TripsTable.COLUMN_TO_TIMEZONE, trip.getEndTimeZone().getID());
        values.put(TripsTable.COLUMN_COMMENT, trip.getComment());
        values.put(TripsTable.COLUMN_COST_CENTER, trip.getCostCenter());
        values.put(TripsTable.COLUMN_DEFAULT_CURRENCY, trip.getDefaultCurrencyCode());
        values.put(TripsTable.COLUMN_UUID, trip.getUuid().toString());
        values.put(TripsTable.COLUMN_NAME_HIDDEN_AUTO_COMPLETE, trip.getAutoCompleteMetadata().isNameHiddenFromAutoComplete());
        values.put(TripsTable.COLUMN_COMMENT_HIDDEN_AUTO_COMPLETE, trip.getAutoCompleteMetadata().isCommentHiddenFromAutoComplete());
        values.put(TripsTable.COLUMN_COSTCENTER_HIDDEN_AUTO_COMPLETE, trip.getAutoCompleteMetadata().isCostCenterHiddenFromAutoComplete());
        if (databaseOperationMetadata.getOperationFamilyType() == OperationFamilyType.Sync) {
            values.putAll(syncStateAdapter.write(trip.getSyncState()));
        } else {
            values.putAll(syncStateAdapter.writeUnsynced(trip.getSyncState()));
        }
        return values;
    }

    public  TripDatabaseAdapter(@NonNull StorageManager storageManager, @NonNull UserPreferenceManager preferences, @NonNull SyncStateAdapter syncStateAdapter);

}