From b599ad5e225587ab7fa1e778da4737914e218660 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 26 Jan 2016 22:11:40 +0100 Subject: [PATCH] Readability Sepparation in PredicateAnd --- src/com/massivecraft/massivecore/PredicateAnd.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/massivecore/PredicateAnd.java b/src/com/massivecraft/massivecore/PredicateAnd.java index 1cfa9940..a622b07d 100644 --- a/src/com/massivecraft/massivecore/PredicateAnd.java +++ b/src/com/massivecraft/massivecore/PredicateAnd.java @@ -8,17 +8,23 @@ import com.google.common.collect.ImmutableList; public class PredicateAnd implements Predicate { // -------------------------------------------- // - // INSTANCE & CONSTRUCT + // INSTANCE // -------------------------------------------- // + @SafeVarargs public static PredicateAnd get(Predicate... predicates) { return new PredicateAnd(predicates); } + public static PredicateAnd get(Collection> predicates) { return new PredicateAnd(predicates); } + + // -------------------------------------------- // + // CONSTRUCT + // -------------------------------------------- // + @SafeVarargs public PredicateAnd(Predicate... predicates) { this(ImmutableList.copyOf(predicates)); } - public static PredicateAnd get(Collection> predicates) { return new PredicateAnd(predicates); } public PredicateAnd(Collection> predicates) { this.predicates = ImmutableList.copyOf(predicates); @@ -40,7 +46,7 @@ public class PredicateAnd implements Predicate { for (Predicate predicate : this.getPredicates()) { - if (!predicate.apply(type)) return false; + if ( ! predicate.apply(type)) return false; } return true; }