mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
refactored the SortBy.getByString
This commit is contained in:
parent
c5002983e3
commit
daed944eb6
2 changed files with 10 additions and 22 deletions
|
@ -32,7 +32,6 @@ import javax.swing.BorderFactory;
|
|||
import javax.swing.border.Border;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class Constants {
|
||||
|
@ -116,23 +115,13 @@ public final class Constants {
|
|||
}
|
||||
|
||||
public static SortBy getByString(String text) {
|
||||
switch (text) {
|
||||
case "Card Type":
|
||||
return CARD_TYPE;
|
||||
case "Casting Cost":
|
||||
return CASTING_COST;
|
||||
case "Rarity":
|
||||
return RARITY;
|
||||
case "Color":
|
||||
return COLOR;
|
||||
case "Color Identity":
|
||||
return COLOR_IDENTITY;
|
||||
case "Name":
|
||||
return NAME;
|
||||
default:
|
||||
for (SortBy sortBy : values()) {
|
||||
if (sortBy.text.equals(text)) {
|
||||
return sortBy;
|
||||
}
|
||||
}
|
||||
return UNSORTED;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ import mage.client.constants.Constants.SortBy;
|
|||
import mage.client.dialog.PreferencesDialog;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public abstract class SortSetting {
|
||||
|
|
Loading…
Reference in a new issue