@Provides @Named(CHILD_FRAGMENT_MANAGER) @PerFragment static FragmentManager childFragmentManager(@Named(FRAGMENT) Fragment fragment) { return fragment.getChildFragmentManager(); }
@Provides @SuppressWarnings("unused") private Function<HubAttributeQueryRequest, Element> getMatchingServiceRequestElementTransformer( IdaKeyStore keyStore, EncryptionKeyStore encryptionKeyStore, EntityToEncryptForLocator entityToEncryptForLocator, SignatureAlgorithm signatureAlgorithm, DigestAlgorithm digestAlgorithm, @Named("HubEntityId") String hubEntityId ) { return hubTransformersFactory.getMatchingServiceRequestToElementTransformer( keyStore, encryptionKeyStore, entityToEncryptForLocator, signatureAlgorithm, digestAlgorithm, hubEntityId ); }
@Test public void qualifiedDependency() throws Exception { class Woot { String foo(@Named("q") int i) { return String.valueOf(i); } } InjectableMethod<?> method = InjectableMethod.forDeclaredMethod(new Woot(), "foo", int.class); String hi = Guice.createInjector( method.bindingModule(), binder -> binder.bind(int.class) .annotatedWith(Names.named("q")) .toInstance(123) ).getInstance(String.class); assertEquals("123", hi); }
@Provides @Named("IdpSamlResponseTransformer") private DecoratedSamlResponseToIdaResponseIssuedByIdpTransformer getResponseToInboundResponseFromIdpTransformer( ConcurrentMap<String, DateTime> assertionIdCache, SamlConfiguration samlConfiguration, @Named("authnResponseKeyStore") SigningKeyStore authnResponseKeyStore, IdaKeyStore keyStore, @Named("HubEntityId") String hubEntityId) { return hubTransformersFactory.getDecoratedSamlResponseToIdaResponseIssuedByIdpTransformer( authnResponseKeyStore, keyStore, samlConfiguration.getExpectedDestinationHost(), Urls.FrontendUrls.SAML2_SSO_RESPONSE_ENDPOINT, assertionIdCache, hubEntityId); }
/** * {@link BevragingVerzoekVerwerker} specifiek voor Zoek Persoon Op Adres. * @return de zoek persoon op adres verzoek verwerker */ @Bean @Named("zoekPersoonOpAdres") public BevragingVerzoekVerwerker<ZoekPersoonOpAdresVerzoek> zoekPersoonOpAdresVerzoekVerwerker() { return new GeneriekeBevragingVerzoekVerwerker<ZoekPersoonOpAdresVerzoek, BevragingResultaat>() { }; }
/** * {@link BevragingVerzoekVerwerker} specifiek voor Geef Details Persoon. * @return de geef details persoon verzoek verwerker */ @Bean @Named("geefDetailsPersoonVerwerker") public BevragingVerzoekVerwerker<GeefDetailsPersoonVerzoek> geefDetailsPersoonVerzoekVerwerker() { return new GeneriekeBevragingVerzoekVerwerker<GeefDetailsPersoonVerzoek, BevragingResultaat>() { }; }
@Inject public RateService(AlbumRateDao albumRateDao, ArtistRateDao artistRateDao, @Named("albumDao") AlbumDao albumDao, @Named("artistDao") ArtistDao artistDao, @Named("userDao") MaprDbDao<User> userDao) { this.albumRateDao = albumRateDao; this.artistRateDao = artistRateDao; this.albumDao = albumDao; this.artistDao = artistDao; this.userDao = userDao; }
/** * Constructor. * @param repository repository */ @Inject protected ConversieAangifteAdreshoudingController( @Named("conversieAangifteAdreshoudingRepository") final ReadWriteRepository<AangifteAdreshouding, Integer> repository) { super(repository, Arrays.asList( new Filter<>(LO3_OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(LO3_OMSCHRIJVING)), new Filter<>(AANGEVER_ID, new ShortValueAdapter(), new EqualPredicateBuilderFactory(AANGEVER_ID)), new Filter<>(REDENWIJZIGINGVERBLIJF_ID, new ShortValueAdapter(), new EqualPredicateBuilderFactory(REDENWIJZIGINGVERBLIJF_ID))), null, Arrays.asList(LO3_OMSCHRIJVING, AANGEVER, REDENWIJZIGINGVERBLIJF)); }
@Inject public DrawerPresenter( @Named("projectGitHubUrl") String projectUrl, Sink<SnackbarMessageEvent> snackbarMessageSink, UrlOpener urlOpener) { this.projectUrl = projectUrl; this.snackbarMessageSink = snackbarMessageSink; this.urlOpener = urlOpener; }
@Provides @Singleton public Cache provideCache(@Named("cacheDir") File cacheDir, @Named("cacheSize") long cacheSize) { Cache cache = null; try { cache = new Cache(new File(cacheDir.getPath(), HTTP_CACHE_PATH), cacheSize); } catch (Exception e) { e.printStackTrace(); } return cache; }
@Singleton @Provides Retrofit provideRetrofit(@Named("ok-1") OkHttpClient client, GsonConverterFactory converterFactory , RxJavaCallAdapterFactory adapterFactory) { return new Retrofit.Builder() .baseUrl(mBaseUrl) .addConverterFactory(converterFactory) .addCallAdapterFactory(adapterFactory) .client(client) .build(); }
@Singleton @Provides @Named("fresco_ok_http") OkHttpClient provideFrescoOkHttpClient() { return new OkHttpClient.Builder() .readTimeout(30, TimeUnit.SECONDS) .writeTimeout(30, TimeUnit.SECONDS) .connectTimeout(30, TimeUnit.SECONDS) .followRedirects(true) .build(); }
@Inject MapLoaderImpl(Loggers loggers, @Named("serverRoot") Path serverRoot, MapConfiguration config, PGMMap.Factory mapFactory, MapErrorTracker mapErrorTracker) { this.mapErrorTracker = mapErrorTracker; this.logger = loggers.get(getClass()); this.serverRoot = serverRoot; this.config = checkNotNull(config); this.mapFactory = mapFactory; }
/** * Constructor. * @param repository repository */ @Inject protected RedenVerkrijgingNLNationaliteitController( @Named("redenVerkrijgingNLNationaliteitRepository") final ReadWriteRepository<RedenVerkrijgingNLNationaliteit, Short> repository) { super(repository, Arrays.asList( new Filter<>(OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(OMSCHRIJVING)), new Filter<>(CODE, new StringValueAdapter(), new EqualPredicateBuilderFactory(CODE))), Collections.emptyList(), Arrays.asList(CODE, OMSCHRIJVING)); }
@Inject public SubscriberConsumer( LeadService lead, Serializer serializer, Committer committer, TransactionsBuffer buffer, DoneNotifier doneNotifier, FullCommitHandler fullCommitHandler, DeserializerClosure deserializerClosure, BufferOverflowCondition bufferOverflowCondition, KafkaFactory kafkaFactory, DataRecoveryConfig dataRecoveryConfig, @Named(DataCapturerBusConfiguration.NODE_ID) UUID consumerId, OnKafkaStop onKafkaStop ) { this.lead = lead; this.serializer = serializer; this.committer = committer; this.buffer = buffer; this.doneNotifier = doneNotifier.setBuffer(buffer); this.fullCommitHandler = fullCommitHandler.setBuffer(buffer); this.deserializerClosure = deserializerClosure.setBuffer(buffer); this.bufferOverflowCondition = bufferOverflowCondition; consumer = kafkaFactory.consumer(dataRecoveryConfig.getConsumerConfig(), onKafkaStop); this.consumerId = consumerId; remoteTopic = dataRecoveryConfig.getRemoteTopic(); reconciliationTopic = dataRecoveryConfig.getReconciliationTopic(); }
/** * Updates an existing {@code User}. * * @param id the ID of the entity to be updated * @param user the desired state of the entity * @return the updated version of the entity * @throws NotFoundException if the {@code id} does not correspond to an existing * {@code User} */ @ApiMethod( name = "update", path = "user/{id}", httpMethod = ApiMethod.HttpMethod.PUT) public User update(@Named("id") Long id, User user) throws NotFoundException { // TODO: You should validate your ID parameter against your resource's ID here. checkExists(id); ofy().save().entity(user).now(); logger.info("Updated User: " + user); return ofy().load().entity(user).now(); }
/** * 提供 {@link RxCache} * * @param cacheDirectory RxCache缓存路径 * @return */ @Singleton @Provides RxCache provideRxCache(Application application, @Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) { RxCache.Builder builder = new RxCache.Builder(); RxCache rxCache = null; if (configuration != null) { rxCache = configuration.configRxCache(application, builder); } if (rxCache != null) return rxCache; return builder .persistence(cacheDirectory, new GsonSpeaker()); }
/** * Constructor. * @param repository repository */ @Inject protected SoortVrijBerichtController(@Named("soortVrijBerichtRepository") final ReadWriteRepository<SoortVrijBericht, Short> repository) { super(repository, Collections.singletonList(new Filter<>(NAAM, new StringValueAdapter(), new LikePredicateBuilderFactory(NAAM))), Collections.emptyList(), Collections.singletonList(NAAM)); }
@Inject public CoastlineGenerator(@Named("com.mappy.fpm.coastline.tomtomFolder") String tomtomFolder, // @Named("com.mappy.fpm.coastline.workspace") String workspace, // OsmosisSerializer serializer) { this.tomtomFolder = tomtomFolder; this.workspace = workspace; this.serializer = serializer; }
@Inject public RawGPSMeasurementsGatherer(SensorConfig sensorConfig, LocationManager locationManager, @Named("gpsSensorEnableRequester") SensorEnableRequester sensorEnableRequester, @Named("fineLocationPermissionChecker") PermissionChecker permissionChecker, @Named("rawGPSSensorChecker") SensorChecker sensorChecker, SensorRequirementChecker sensorRequirementChecker) { super(sensorConfig, locationManager, sensorEnableRequester, permissionChecker, sensorChecker, sensorRequirementChecker); }
/** * 需要单独给 {@link RxCache} 提供缓存路径 * * @param cacheDir * @return */ @Singleton @Provides @Named("RxCacheDirectory") File provideRxCacheDirectory(File cacheDir) { File cacheDirectory = new File(cacheDir, "RxCache"); return DataHelper.makeDirs(cacheDirectory); }
@Inject public MetadataCertificateValidator( MetadataResolver metadataResolver, MetadataCertificatesRepository metadataCertificatesRepository, @Named("HubEntityId") String hubEntityId, @Named("HubFederationId") String hubFederationId) { this.metadataResolver = metadataResolver; this.metadataCertificatesRepository = metadataCertificatesRepository; this.hubEntityId = hubEntityId; this.hubFederationId = hubFederationId; }
/** * 提供 {@link RxCache} * * @param cacheDirectory RxCache 缓存路径 * @return RxCache */ @Singleton @Provides RxCache provideRxCache(@Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) { RxCache.Builder builder = new RxCache.Builder(); RxCache rxCache = null; if (configuration != null) { rxCache = configuration.configRxCache(mApplication, builder); } if (rxCache != null) { return rxCache; } return builder.persistence(cacheDirectory, new GsonSpeaker()); }
@Inject public HubAsIdpMetadataHandler( MetadataResolver metadataResolver, SamlProxyConfiguration samlProxyConfiguration, @Named("HubEntityId") String hubEntityId, @Named("HubFederationId") String hubFederationId) { this.samlProxyConfiguration = samlProxyConfiguration; this.metadataResolver = metadataResolver; this.hubEntityId = hubEntityId; this.hubFederationId = hubFederationId; }
/** * Constructor. * @param repository repository */ @Inject protected ConversieRedenBeeindigenNationaliteitController( @Named("conversieRedenBeeindigenNationaliteitRepository") final ReadWriteRepository<RedenBeeindigingNationaliteit, Integer> repository) { super(repository, Arrays.asList( new Filter<>(LO3_OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(LO3_OMSCHRIJVING)), new Filter<>(REDEN_VERLIES_NATIONALITEIT, new StringValueAdapter(), new EqualPredicateBuilderFactory(REDEN_VERLIES_NATIONALITEIT)), new Filter<>(REDEN_VERLIES_NATIONALITEIT_ID, new ShortValueAdapter(), new EqualPredicateBuilderFactory(REDEN_VERLIES_NATIONALITEIT_ID))), null, Arrays.asList(LO3_OMSCHRIJVING, REDEN_VERLIES_NATIONALITEIT)); }
/** * Constructor. * @param repository repository */ @Inject protected AanduidingInhoudingVermissingReisdocumentController( @Named("aanduidingInhoudingVermissingReisdocumentRepository") final ReadWriteRepository<AanduidingInhoudingOfVermissingReisdocument, Short> repository) { super(repository, Collections.<Filter<?>>emptyList(), null, SORTERINGEN); }
@Inject public MessageViewModel(MessageRepository messageRepository, @Named("vm") CompositeDisposable compositeDisposable) { Timber.d("Init MessageViewModel"); this.repository = messageRepository; this.compositeDisposable = compositeDisposable; this.messageIdentifier = new Identifier(); this.subject = PublishSubject.create(); this.messages = new MutableLiveData<>(); }
@Inject public ColorManager(@Named("nrColors") int nrColors, ColorFactory factory) { log.log(DEBUG,"creating colorManager for {0} colors",nrColors); this.nrColors = nrColors; this.factory = factory; createOrdering(); }
@Inject public WebPreferencesFactory(PreferencesService service, @Named("PREFS_TIMEOUT") Long timeoutMillis) { Preconditions.checkNotNull(service, "Missing a PreferencesService"); Preconditions.checkNotNull(timeoutMillis, "Missing a timeout argument"); Preconditions.checkArgument(timeoutMillis > 100, "The timeout was less than 100 ms. This isn't allowed."); this.systemRoot = new WebPreferences(service, timeoutMillis, null, ""); }
@Provides @Singleton @Named("LOGIN_URL") String provideLoginApiUrl() { return Constants.LOGIN_URL; }
@Inject ConfigurableCleanupStrategy(Set<CleanupProcessor> cleanupProcessors, @Named(CleanupModule.CLEANUP_STRATEGY_KEY) String strategies) { this.processors = ModuleHelper.sortImplementations(strategies, cleanupProcessors, CleanupProcessors::valueOf); }
@Singleton @Named("hotViralImages") @Provides Observable<List<Image>> provideHotViralImages(ImgurObservables imgurObservables) { return imgurObservables.getHotViralImages(5 /*maxPages*/); }
@Inject public MatchingServiceHealthcheckRequestGeneratorService(AttributeQueryGenerator<MatchingServiceHealthCheckRequest> attributeQueryGenerator, @Named("HubEntityId") String hubEntityId) { this.attributeQueryGenerator = attributeQueryGenerator; this.hubEntityId = hubEntityId; }
@Inject ConfigurableMatcherStrategy(@Named(ScanModule.PROFILE_STRATEGY_KEY) String strategies, Set<ProfileMatcher> matchers) { this.matchers = ModuleHelper.sortImplementations(strategies, matchers, ProfileMatchers::valueOf); }
@Binds @IntoSet @Named("TALON_CONFIG_CL") public abstract Command motionMagicCruiseVelocityCommand( MotionMagicCruiseVelocityCommand command);
@Binds @IntoSet @Named("TALON_CONFIG_LIM") public abstract Command enableForwardSoftLimitCommand(EnableForwardSoftLimitCommand command);
@Binds @Singleton @IntoSet @Named("MAIN") public abstract Command servoModeCommand(ServoModeCommand command);
@Inject public AppTokenClientFilter(@Named(APP_TOKEN_SUPPLIER_BIND_NAME) Supplier<String> appTokenSupplier) { this.appTokenSupplier = appTokenSupplier; }
@Inject public Geonames(@Named("com.mappy.fpm.geonames") String path) { alternateNames = alternateNames(path + "/alternateNames.txt"); idByCountry = idByCountry(path + "/countryInfo.txt"); }
/** * Constructor. * @param dataSource datasource */ @Inject public DBUnitBrpUtil(@Named("syncDalDataSource") final DataSource dataSource) throws DataSetException { this.dataSource = dataSource; initTabellen(); }