Class NameHelper

java.lang.Object
org.sgrewritten.stargate.util.NameHelper

public final class NameHelper extends Object
A helper class for dealing with portal and network names
  • Method Details

    • getTrimmedName

      public static String getTrimmedName(String name)
      Trims a name and replaces whitespace with normal spaces
      Parameters:
      name -

      The name to check

      Returns:

      The trimmed name

    • getNormalizedName

      public static String getNormalizedName(String name)
      Gets the normalized version of the given name

      This 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

      public static boolean isInvalidName(String name)
      Checks the length of the name
      Parameters:
      name -

      The name to be checked

      Returns:

      If the name has a valid length