diff --git a/src/main/java/forge/item/ItemPredicate.java b/src/main/java/forge/item/ItemPredicate.java index 780d4b48fc5..ac5b3935ddf 100644 --- a/src/main/java/forge/item/ItemPredicate.java +++ b/src/main/java/forge/item/ItemPredicate.java @@ -14,38 +14,16 @@ public abstract class ItemPredicate { // Static builder methods - they choose concrete implementation by // themselves - /** - * Checks that the inventory item is a Booster Pack. - * - * @return the predicate - */ - public static Predicate IsBoosterPack = new Predicate() { - - @Override - public boolean apply(final InventoryItem card) { - return card instanceof BoosterPack; - } - }; - - /** - * Checks that the inventory item is a Fat Pack. - * - * @return the predicate - */ - public static Predicate IsFatPack = new Predicate() { - - @Override - public boolean apply(final InventoryItem card) { - return card instanceof FatPack; - } - }; + public static final Predicate IsBoosterPack = Predicates.instanceOf(BoosterPack.class); + public static final Predicate IsPrebuiltDeck = Predicates.instanceOf(PreconDeck.class); + public static final Predicate IsFatPack = Predicates.instanceOf(TournamentPack.class); /** * Checks that the inventory item is a Tournament Pack. * * @return the predicate */ - public static Predicate IsTournamentPack = new Predicate() { + public static final Predicate IsTournamentPack = new Predicate() { @Override public boolean apply(final InventoryItem card) { @@ -58,7 +36,7 @@ public abstract class ItemPredicate { * * @return the predicate */ - public static Predicate IsStarterDeck = new Predicate() { + public static final Predicate IsStarterDeck = new Predicate() { @Override public boolean apply(final InventoryItem card) { @@ -71,21 +49,12 @@ public abstract class ItemPredicate { * * @return the predicate */ - public static Predicate IsPrebuiltDeck = new Predicate() { - - @Override - public boolean apply(final InventoryItem card) { - return card instanceof PreconDeck; - } - }; + /** * The Class Presets. */ public static class Presets { - - - /** The Item IsPack. */ @SuppressWarnings("unchecked") public static final Predicate IS_PACK = Predicates.or(IsBoosterPack, IsFatPack, IsTournamentPack);