Ensure words are fully capitalised

Previously only the first word was capitalised.
This commit is contained in:
Keir Nellyer 2016-07-14 19:25:53 +01:00
parent 7f48151c8c
commit 15b5198dbb
3 changed files with 8 additions and 9 deletions

View File

@ -1,6 +1,6 @@
package mineplex.core.report;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
/**
* Contains the reasons a player can be reported for.
@ -23,12 +23,12 @@ public enum ReportCategory
CHAT_ABUSE(2);
private final int _id;
private final String _humanName;
private final String _name;
ReportCategory(int id)
{
_id = id;
_humanName = StringUtils.capitalize(name().toLowerCase().replace("_", " "));
_name = WordUtils.capitalizeFully(name().replace('_', ' '));
}
/**
@ -41,9 +41,9 @@ public enum ReportCategory
return _id;
}
public String getHumanName()
public String getName()
{
return _humanName;
return _name;
}
public static ReportCategory getById(int id)

View File

@ -1,6 +1,6 @@
package mineplex.core.report;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
/**
* Contains all possible outcomes for a report.
@ -20,7 +20,7 @@ public enum ReportResultType
{
_id = id;
_globalStat = globalStat;
_name = StringUtils.capitalize(name().toLowerCase().replace('_', ' '));
_name = WordUtils.capitalizeFully(name().replace('_', ' '));
}
public int getId()

View File

@ -4,7 +4,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;
import org.bukkit.ChatColor;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.chatsnap.SnapshotRepository;
@ -53,7 +52,7 @@ public class ReportHandlerMessageTask extends BukkitRunnable
.add("\n")
.add(prefix + C.cAqua + "Suspect - " + C.cGold + suspectName)
.add("\n")
.add(prefix + C.cAqua + "Type - " + C.cGold + _report.getCategory().getHumanName())
.add(prefix + C.cAqua + "Type - " + C.cGold + _report.getCategory().getName())
.add("\n" + prefix + "\n")
.add(prefix + C.cGold + _report.getMessages().size() + C.cAqua + " total reports")
.add("\n")