Refactor: Delete Unused Methods cardExists (#9244)

This commit is contained in:
DeepCrimson 2022-07-08 18:30:37 -07:00 committed by GitHub
parent 05648f8c0c
commit f20210037b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,6 @@ import com.j256.ormlite.stmt.Where;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.support.DatabaseConnection;
import com.j256.ormlite.table.TableUtils;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetType;
import mage.constants.SuperType;
@ -107,40 +106,6 @@ public enum CardRepository {
}
}
public boolean cardExists(String className) {
try {
if (classNames == null) {
QueryBuilder<CardInfo, Object> qb = cardDao.queryBuilder();
qb.distinct().selectColumns("className").where().isNotNull("className");
List<CardInfo> results = cardDao.query(qb.prepare());
classNames = new TreeSet<>();
for (CardInfo card : results) {
classNames.add(card.getClassName());
}
}
return classNames.contains(className);
} catch (SQLException ex) {
}
return false;
}
public boolean cardExists(CardSetInfo className) {
try {
if (classNames == null) {
QueryBuilder<CardInfo, Object> qb = cardDao.queryBuilder();
qb.distinct().selectColumns("className").where().isNotNull("className");
List<CardInfo> results = cardDao.query(qb.prepare());
classNames = new TreeSet<>();
for (CardInfo card : results) {
classNames.add(card.getClassName());
}
}
return classNames.contains(className.getName());
} catch (SQLException ex) {
}
return false;
}
private void addNewNames(CardInfo card, Set<String> namesList) {
// require before call: qb.distinct().selectColumns("name", "modalDoubleFacesSecondSideName"...);