@Test public void testIsBacked() { final Project backedProject = ProjectFactory.backedProject(); assertTrue(BackingUtils.isBacked(backedProject, backedProject.backing().reward())); assertFalse(BackingUtils.isBacked(backedProject, RewardFactory.reward())); assertFalse(BackingUtils.isBacked(backedProject, RewardFactory.noReward())); final Project noRewardBackedProject = ProjectFactory.backedProject().toBuilder() .backing(BackingFactory.backing(backedProject, UserFactory.user(), RewardFactory.noReward())) .build(); assertTrue(BackingUtils.isBacked(noRewardBackedProject, RewardFactory.noReward())); }
public static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward) { final Backing backing = project.backing(); if (backing == null) { return false; } final Long rewardId = backing.rewardId(); if (rewardId == null) { return RewardUtils.isNoReward(reward); } return rewardId == reward.id(); }
BackingUtils { public static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward) { final Backing backing = project.backing(); if (backing == null) { return false; } final Long rewardId = backing.rewardId(); if (rewardId == null) { return RewardUtils.isNoReward(reward); } return rewardId == reward.id(); } }
BackingUtils { public static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward) { final Backing backing = project.backing(); if (backing == null) { return false; } final Long rewardId = backing.rewardId(); if (rewardId == null) { return RewardUtils.isNoReward(reward); } return rewardId == reward.id(); } private  BackingUtils(); }
BackingUtils { public static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward) { final Backing backing = project.backing(); if (backing == null) { return false; } final Long rewardId = backing.rewardId(); if (rewardId == null) { return RewardUtils.isNoReward(reward); } return rewardId == reward.id(); } private  BackingUtils(); static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward); static boolean isErrored(final @Nullable Backing backing); static boolean isShippable(final @NonNull Backing backing); static @Nullable Reward backedReward(final @NonNull Project project); }
BackingUtils { public static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward) { final Backing backing = project.backing(); if (backing == null) { return false; } final Long rewardId = backing.rewardId(); if (rewardId == null) { return RewardUtils.isNoReward(reward); } return rewardId == reward.id(); } private  BackingUtils(); static boolean isBacked(final @NonNull Project project, final @NonNull Reward reward); static boolean isErrored(final @Nullable Backing backing); static boolean isShippable(final @NonNull Backing backing); static @Nullable Reward backedReward(final @NonNull Project project);  }