Package org.sgrewritten.stargate.util
Class NameHelper
java.lang.Object
org.sgrewritten.stargate.util.NameHelper
A helper class for dealing with portal and network names
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getNormalizedName
(String name) Gets the normalized version of the given namestatic String
getTrimmedName
(String name) Trims a name and replaces whitespace with normal spacesstatic boolean
isInvalidName
(String name) Checks the length of the name
-
Method Details
-
getTrimmedName
Trims a name and replaces whitespace with normal spaces- Parameters:
name
-The name to check
- Returns:
The trimmed name
-
getNormalizedName
Gets the normalized version of the given nameThis basically just lower-cases the name, trims the name and strips color if enabled. This is to make names case-agnostic and optionally color-agnostic.
- Parameters:
name
-The name to "hash"
- Returns:
The "hashed" name
-
isInvalidName
Checks the length of the name- Parameters:
name
-The name to be checked
- Returns:
If the name has a valid length
-