• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Preconditions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中dagger.internal.Preconditions的典型用法代码示例。如果您正苦于以下问题:Java Preconditions类的具体用法?Java Preconditions怎么用?Java Preconditions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Preconditions类属于dagger.internal包,在下文中一共展示了Preconditions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fromGoosciSpec

import dagger.internal.Preconditions; //导入依赖的package包/类
public static ExternalSensorSpec fromGoosciSpec(GoosciSensorSpec.SensorSpec spec,
        Map<String, SensorProvider> providerMap) {
    Preconditions.checkNotNull(providerMap);
    if (spec == null) {
        return null;
    }
    GoosciGadgetInfo.GadgetInfo info = Preconditions.checkNotNull(spec.info);
    SensorProvider sensorProvider = providerMap.get(info.providerId);
    if (sensorProvider == null) {
        throw new IllegalArgumentException("No provider for sensor type: "
                                           + info.providerId
                                           + ". Options: "
                                           + providerMap.keySet());
    }

    return sensorProvider.buildSensorSpec(spec.rememberedAppearance.name, spec.config);
}
 
开发者ID:google,项目名称:science-journal,代码行数:18,代码来源:ExternalSensorSpec.java


示例2: transform

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override
public ApodModel transform(ApodResponse apodResponse) {
    Preconditions.checkNotNull(apodResponse);

    ApodModel apodModel = new ApodModel();
    apodModel.setDate(apodResponse.getDate());
    apodModel.setExplanation(apodResponse.getExplanation());
    apodModel.setHdurl(apodResponse.getHdurl());
    apodModel.setMedia_type(apodResponse.getMediaType());
    apodModel.setService_version(apodResponse.getServiceVersion());
    apodModel.setTitle(apodResponse.getTitle());
    apodModel.setUrl(apodResponse.getUrl());
    apodModel.setCopyright(apodResponse.getCopyright());

    return apodModel;
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:17,代码来源:ApodModelDataMapper.java


示例3: inject

import dagger.internal.Preconditions; //导入依赖的package包/类
public static void inject(Controller controller) {
  Preconditions.checkNotNull(controller, "controller");
  HasControllerInjector hasDispatchingControllerInjector = findHasControllerInjector(controller);
  Log.d("dagger.android", String.format("An injector for %s was found in %s", controller.getClass().getCanonicalName(),
      hasDispatchingControllerInjector.getClass().getCanonicalName()));
  DispatchingAndroidInjector<Controller> controllerInjector = hasDispatchingControllerInjector.controllerInjector();
  Preconditions.checkNotNull(controllerInjector, "%s.controllerInjector() returned null",
      hasDispatchingControllerInjector.getClass().getCanonicalName());
  controllerInjector.inject(controller);
}
 
开发者ID:Bodo1981,项目名称:conductor-dagger,代码行数:11,代码来源:ConductorInjection.java


示例4: copyAsNew

import dagger.internal.Preconditions; //导入依赖的package包/类
@NonNull
public static Meal copyAsNew(@NonNull Meal meal) {
    Meal newMeal = new Meal();
    newMeal.name = "";
    newMeal.imageUri = meal.imageUri;
    List<Ingredient> ingredients = meal.getIngredients();
    List<Ingredient> newIngredients = new ArrayList<>(ingredients.size());
    for (Ingredient old : ingredients) {
        IngredientTemplate template = Preconditions.checkNotNull(old.getIngredientTypeOrNull());
        newIngredients.add(new Ingredient(template, old.getAmount()));
    }
    newMeal.ingredients = newIngredients;
    return newMeal;
}
 
开发者ID:st1hy,项目名称:Red-Calorie,代码行数:15,代码来源:Meal.java


示例5: onCreateViewHolder

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override
public IngredientItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false);
    Preconditions.checkNotNull(view);
    return factory.newAddMealFragmentComponent(new IngredientListModule(view))
            .getHolder();
}
 
开发者ID:st1hy,项目名称:Red-Calorie,代码行数:8,代码来源:IngredientsListAdapter.java


示例6: build

import dagger.internal.Preconditions; //导入依赖的package包/类
public ScrollingItemDelegate build() {
    Preconditions.checkNotNull(left);
    Preconditions.checkNotNull(center);
    Preconditions.checkNotNull(right);
    Preconditions.checkNotNull(scrollView);
    return new ScrollingItemDelegate(this);
}
 
开发者ID:st1hy,项目名称:Red-Calorie,代码行数:8,代码来源:ScrollingItemDelegate.java


示例7: MainPresenter

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public MainPresenter(MainScreenInterapter mainScreenInterapter,
                     MainScreenModelDataMapper mainScreenModelDataMapper,
                     ITracking tracking) {
    super(Preconditions.checkNotNull(mainScreenInterapter), Preconditions.checkNotNull(mainScreenModelDataMapper)
            , Preconditions.checkNotNull(tracking));

    tracking.LogEventScreen("MainScreen");
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:10,代码来源:MainPresenter.java


示例8: PhotoCommentPresenter

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public PhotoCommentPresenter(CommentsInteraptor comments,
                             ITracking tracking) {
    this.comments = Preconditions.checkNotNull(comments);
    this.tracking = Preconditions.checkNotNull(tracking);

    tracking.LogEventScreen("PhotoCommentScreen");
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:9,代码来源:PhotoCommentPresenter.java


示例9: MarsPhotosPresenter

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public MarsPhotosPresenter(MarsPhotosInteraptor marsPhotosInteraptor,
                           MarsPhotosModelDataMapper marsPhotosModelDataMapper,
                           CommentsInteraptor comments,
                           ITracking tracking) {
    super(Preconditions.checkNotNull(marsPhotosInteraptor), Preconditions.checkNotNull(marsPhotosModelDataMapper)
            , Preconditions.checkNotNull(tracking));
    this.comments = Preconditions.checkNotNull(comments);

    tracking.LogEventScreen("MarsPhotosScreen");
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:12,代码来源:MarsPhotosPresenter.java


示例10: PlanetaryApodPresenter

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public PlanetaryApodPresenter(PlanetaryApodInteraptor planetaryApodInteraptor,
                              ApodModelDataMapper apodModelDataMapper,
                              ITracking tracking) {
    super(Preconditions.checkNotNull(planetaryApodInteraptor), Preconditions.checkNotNull(apodModelDataMapper), Preconditions.checkNotNull(tracking));
    tracking.LogEventScreen("PlanetaryApodScreen");
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:8,代码来源:PlanetaryApodPresenter.java


示例11: transform

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override
public MarsPhotosModel transform(MarsPhotosResponse marsPhotosResponses) {
    Preconditions.checkNotNull(marsPhotosResponses);

    MarsPhotosModel marsPhotosModel = new MarsPhotosModel();
    if (marsPhotosResponses.getPhotos() == null) {
        return marsPhotosModel;
    }

    MarsPhoto marsPhoto = null;

    if (marsPhotosResponses.getPhotos().size() > 0) {
        for (Photo photo : marsPhotosResponses.getPhotos()) {
            marsPhoto = new MarsPhoto();

            marsPhoto.setEarthDate(photo.getEarthDate());
            marsPhoto.setId(photo.getId());
            marsPhoto.setImgSrc(photo.getImgSrc());

            if (photo.getCamera() != null) {
                marsPhoto.setCameraFullName(photo.getCamera().getFullName());
                marsPhoto.setCameraName(photo.getCamera().getName());
            }

            if (photo.getRover() != null) {
                marsPhoto.setRoverId(photo.getRover().getId());
                marsPhoto.setRoverLandingDate(photo.getRover().getLandingDate());
                marsPhoto.setRoverName(photo.getRover().getName());
            }

            marsPhotosModel.getMarsPhotos().add(marsPhoto);
        }
    }
    return marsPhotosModel;
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:36,代码来源:MarsPhotosModelDataMapper.java


示例12: transform

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override
public MainScreenModule transform(List<MainScreenEntity> screenEntities) {
    Preconditions.checkNotNull(screenEntities);

    MainScreenModule mainScreenModule = new MainScreenModule();

    for(int i = 0 ; i < screenEntities.size() ; i ++){
        mainScreenModule.setAddItem(new MainScreen(screenEntities.get(i).getName(), i == 0 ? R.drawable.item_2 : R.drawable.item_1));
    }

    return mainScreenModule;
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:13,代码来源:MainScreenModelDataMapper.java


示例13: PlanetaryApodInteraptor

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public PlanetaryApodInteraptor(@NonNull IPlanetaryApod planetaryApod,
                               @NonNull Scheduler mainScheduler,
                               @NonNull Scheduler ioScheduler) {
    super(mainScheduler, ioScheduler);

    this.planetaryApod = Preconditions.checkNotNull(planetaryApod);
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:9,代码来源:PlanetaryApodInteraptor.java


示例14: CommentsInteraptor

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public CommentsInteraptor(@NonNull IComments comments,
                          @NonNull Scheduler mainScheduler,
                          @NonNull Scheduler ioScheduler) {
    super(mainScheduler, ioScheduler);

    this.comments = Preconditions.checkNotNull(comments);
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:9,代码来源:CommentsInteraptor.java


示例15: MarsPhotosInteraptor

import dagger.internal.Preconditions; //导入依赖的package包/类
@Inject
public MarsPhotosInteraptor(@NonNull IMarsPhotos marsPhotos,
                            @NonNull Scheduler mainScheduler,
                            @NonNull Scheduler ioScheduler) {
    super(mainScheduler, ioScheduler);

    this.marsPhotos = Preconditions.checkNotNull(marsPhotos);
}
 
开发者ID:lolevsky,项目名称:Android-Clean-Architecture,代码行数:9,代码来源:MarsPhotosInteraptor.java


示例16: BasePresenter

import dagger.internal.Preconditions; //导入依赖的package包/类
protected BasePresenter(@NonNull BaseInteractor interactor,
        @NonNull IModelDataMapper<K, M> modelDataMapper, IAnalytics analytics) {
    this.interactor = Preconditions.checkNotNull(interactor);
    this.modelDataMapper = Preconditions.checkNotNull(modelDataMapper);
    this.analytics = Preconditions.checkNotNull(analytics);
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:7,代码来源:BasePresenter.java


示例17: transform

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override public OnBoardingScreenModule transform(List<OnBoardingData> dataList) {
    Preconditions.checkNotNull(dataList);
    OnBoardingScreenModule mainScreenModule = new OnBoardingScreenModule();
    mainScreenModule.setPagerList(dataList);
    return mainScreenModule;
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:7,代码来源:OnBoardingScreenModelDataMapper.java


示例18: transform

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override public OnBoardingPageModule transform(OnBoardingData onBoardingData) {
    Preconditions.checkNotNull(onBoardingData);
    OnBoardingPageModule mainScreenModule = new OnBoardingPageModule();
    mainScreenModule.setOnBoardingData(onBoardingData);
    return mainScreenModule;
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:7,代码来源:OnBoardingPageModelDataMapper.java


示例19: BaseInteractor

import dagger.internal.Preconditions; //导入依赖的package包/类
BaseInteractor(@NonNull Scheduler observerScheduler, @NonNull Scheduler subscribeScheduler) {
    this.observerScheduler = Preconditions.checkNotNull(observerScheduler);
    this.subscribeScheduler = Preconditions.checkNotNull(subscribeScheduler);
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:5,代码来源:BaseInteractor.java


示例20: buildUseCaseObservable

import dagger.internal.Preconditions; //导入依赖的package包/类
@Override public Observable buildUseCaseObservable(Object... params) {
    Preconditions.checkNotNull(params);
    return iPhotos.getPhotos((int) params[0]);
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:5,代码来源:ImagePageInteractor.java



注:本文中的dagger.internal.Preconditions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GridWorldDomain类代码示例发布时间:2022-05-23
下一篇:
Java DTLSConnector类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap