/** * Provides utility methods for mathematics. */ @Reusable public final class MathUtils { @Inject MathUtils() { } public float toMiles(float meters) { return meters * 0.000621371f; } }
/** * An {@link Executor} that simply runs any runnable it is given. */ @Reusable final class BlockingExecutor implements Executor { @Inject BlockingExecutor() { } @Override public void execute(@NonNull Runnable runnable) { runnable.run(); } }
@Binds @Reusable abstract EntityMapper<BusinessTransactionTypeEntity, BusinessTransactionType> businessTransactionTypeEntityMapper(BusinessTransactionTypeEntityMapper businessTransactionTypeEntityMapper);
@Binds @Reusable abstract ModelMapper<BusinessTransactionTypeModel, BusinessTransactionType> businessTransactionTypeModelMapper(BusinessTransactionTypeModelMapper businessTransactionTypeModelMapper);
@Binds @Reusable abstract PostExecutionThread postExecutionThread(BlockingPostExecutionThread blockingPostExecutionThread); }
@Provides @Reusable // to avoid parsing options more than once CompilerOptions compilerOptions() { return CompilerOptions.create(processingEnvironment); } }
@Provides @Reusable static AuthTokenService authTokenService(DataServiceFactory dataServiceFactory) { return dataServiceFactory.create(AuthTokenService.class); } }
@Binds @Reusable abstract EntityMapper<CoordinatesEntity, Coordinates> coordinatesEntityMapper(CoordinatesEntityMapper coordinatesEntityMapper); }
@Binds @Reusable abstract ModelMapper<CoordinatesModel, Coordinates> coordinatesModelMapper(CoordinatesModelMapper coordinatesModelMapper); }
@Binds @Reusable abstract ModelMapper<LocationModel, Location> locationModelMapper(LocationModelMapper locationModelMapper);
@Binds @Reusable abstract EntityMapper<BusinessEntity, Business> businessEntityMapper(BusinessEntityMapper businessEntityMapper);
@Binds @Reusable abstract ModelMapper<BusinessModel, Business> businessModelMapper(BusinessModelMapper businessModelMapper);
@Binds @Reusable abstract ModelMapper<BusinessHourModel, BusinessHour> businessHourModelMapper(BusinessHourModelMapper businessHourModelMapper);
@Binds @Reusable abstract EntityValidator<BusinessEntity> businessEntityValidator(BusinessEntityValidator businessEntityValidator);
@Binds @Reusable abstract EntityValidator<LocationEntity> locationEntityValidator(LocationEntityValidator locationEntityValidator);
@Binds @Reusable abstract EntityMapper<BusinessHourEntity, BusinessHour> businessHourEntityMapper(BusinessHourEntityMapper businessHourEntityMapper);
@Binds @Reusable abstract EntityMapper<BusinessHoursEntity, BusinessHours> businessHoursEntityMapper(BusinessHoursEntityMapper businessHoursEntityMapper);
@Binds @Reusable abstract Display display(DisplayIO displayIO); }
@Binds @Reusable abstract BusinessRepository businessRepository(BusinessDataRepository businessDataRepository); }
@Binds @Reusable abstract NetworkStatus networkStatus(DeviceNetworkStatus deviceNetworkStatus); }