mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Guava migration - Fix lingering build errors
This commit is contained in:
@@ -46,7 +46,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
|
||||
private final String exlcudedCardSet = "DS0";
|
||||
|
||||
// need this to obtain cardReference by name+set+artindex
|
||||
private final ListMultimap<String, PaperCard> allCardsByName = Multimaps.newListMultimap(new TreeMap<>(String.CASE_INSENSITIVE_ORDER), CollectionSuppliers.arrayLists());
|
||||
private final ListMultimap<String, PaperCard> allCardsByName = Multimaps.newListMultimap(new TreeMap<>(String.CASE_INSENSITIVE_ORDER), Lists::newArrayList);
|
||||
private final Map<String, PaperCard> uniqueCardsByName = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
|
||||
private final Map<String, CardRules> rulesByName;
|
||||
private final Map<String, ICardFace> facesByName = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
|
||||
|
||||
@@ -403,7 +403,7 @@ public final class CardEdition implements Comparable<CardEdition> {
|
||||
public List<CardInSet> getCardInSet(String cardName){
|
||||
if (cardsInSetLookupMap == null) {
|
||||
// initialise
|
||||
cardsInSetLookupMap = Multimaps.newListMultimap(new TreeMap<>(String.CASE_INSENSITIVE_ORDER), CollectionSuppliers.arrayLists());
|
||||
cardsInSetLookupMap = Multimaps.newListMultimap(new TreeMap<>(String.CASE_INSENSITIVE_ORDER), Lists::newArrayList);
|
||||
List<CardInSet> cardsInSet = this.getAllCardsInSet();
|
||||
for (CardInSet cis : cardsInSet){
|
||||
String key = cis.name;
|
||||
|
||||
@@ -25,7 +25,6 @@ import forge.card.CardDb;
|
||||
import forge.card.CardEdition;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.item.PaperCard;
|
||||
import forge.util.CollectionSuppliers;
|
||||
import forge.util.ItemPool;
|
||||
import forge.util.ItemPoolSorter;
|
||||
import forge.util.MyRandom;
|
||||
@@ -205,7 +204,7 @@ public class CardPool extends ItemPool<PaperCard> {
|
||||
*/
|
||||
public ListMultimap<Integer, CardEdition> getCardEditionsGroupedByNumberOfCards(boolean includeBasicLands){
|
||||
Map<CardEdition, Integer> editionsFrequencyMap = this.getCardEditionStatistics(includeBasicLands);
|
||||
ListMultimap<Integer, CardEdition> reverseMap = Multimaps.newListMultimap(new HashMap<>(), CollectionSuppliers.arrayLists());
|
||||
ListMultimap<Integer, CardEdition> reverseMap = Multimaps.newListMultimap(new HashMap<>(), Lists::newArrayList);
|
||||
for (Map.Entry<CardEdition, Integer> entry : editionsFrequencyMap.entrySet())
|
||||
reverseMap.put(entry.getValue(), entry.getKey());
|
||||
return reverseMap;
|
||||
|
||||
@@ -79,9 +79,8 @@ public class Iterables {
|
||||
return iterable.stream().filter(predicate).findFirst().orElse(defaultValue);
|
||||
}
|
||||
|
||||
public static <T> boolean removeIf(Iterable<T> iterable, Predicate<T> test) {
|
||||
//TODO: Convert parameter type
|
||||
return ((Collection<T>) iterable).removeIf(test);
|
||||
public static <T> boolean removeIf(Collection<T> iterable, Predicate<? super T> test) {
|
||||
return iterable.removeIf(test);
|
||||
}
|
||||
|
||||
public static boolean removeAll(Collection<?> removeFrom, Collection<?> toRemove) {
|
||||
@@ -105,14 +104,14 @@ public class Iterables {
|
||||
}
|
||||
|
||||
public static <T> T getFirst(List<? extends T> iterable, T defaultValue) {
|
||||
return iterable.isEmpty() ? defaultValue : iterable.getFirst();
|
||||
return iterable.isEmpty() ? defaultValue : iterable.get(0);
|
||||
}
|
||||
|
||||
public static <T> T getLast(List<T> iterable) {
|
||||
return iterable.getLast();
|
||||
return iterable.get(iterable.size() - 1);
|
||||
}
|
||||
public static <T> T getLast(List<? extends T> iterable, T defaultValue) {
|
||||
return iterable.isEmpty() ? defaultValue : iterable.getLast();
|
||||
return iterable.isEmpty() ? defaultValue : iterable.get(iterable.size() - 1);
|
||||
}
|
||||
public static boolean isEmpty(Collection<?> iterable) {
|
||||
return iterable.isEmpty();
|
||||
|
||||
Reference in New Issue
Block a user