Switch Style to Preconditions.

Dieser Commit ist enthalten in:
sk89q 2014-06-28 19:13:46 -07:00
Ursprung d7d7b2741a
Commit d86d81ef21

Datei anzeigen

@ -20,11 +20,13 @@
package com.sk89q.worldedit.util.formatting;
import com.google.common.collect.Maps;
import org.apache.commons.lang.Validate;
import java.util.Map;
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.
*
@ -194,8 +196,8 @@ public enum Style {
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
*/
public static Style getByChar(String code) {
Validate.notNull(code, "Code cannot be null");
Validate.isTrue(code.length() > 0, "Code must have at least one char");
checkNotNull(code);
checkArgument(!code.isEmpty(), "Code must have at least one character");
return BY_CHAR.get(code.charAt(0));
}