mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Switch Style to Preconditions.
This commit is contained in:
parent
d7d7b2741a
commit
d86d81ef21
@ -20,11 +20,13 @@
|
|||||||
package com.sk89q.worldedit.util.formatting;
|
package com.sk89q.worldedit.util.formatting;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All supported color values for chat.
|
* All supported color values for chat.
|
||||||
*
|
*
|
||||||
@ -194,8 +196,8 @@ public enum Style {
|
|||||||
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
|
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
public static Style getByChar(String code) {
|
public static Style getByChar(String code) {
|
||||||
Validate.notNull(code, "Code cannot be null");
|
checkNotNull(code);
|
||||||
Validate.isTrue(code.length() > 0, "Code must have at least one char");
|
checkArgument(!code.isEmpty(), "Code must have at least one character");
|
||||||
|
|
||||||
return BY_CHAR.get(code.charAt(0));
|
return BY_CHAR.get(code.charAt(0));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user