Package io.urf.surf

Class SURF.Name

  • Enclosing class:
    SURF

    public static final class SURF.Name
    extends java.lang.Object
    Utilities for working with SURF names.
    Author:
    Garret Wilson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.regex.Pattern PATTERN
      A SURF name is a single name token.
      static java.util.regex.Pattern TOKEN_PATTERN
      Regular expression pattern to match a SURF name token .
    • Constructor Summary

      Constructors 
      Constructor Description
      Name()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String checkArgumentValid​(java.lang.String string)
      Confirms that the given string conforms to the rules for a SURF name.
      static java.lang.String checkArgumentValidToken​(java.lang.String string)
      Confirms that the given string conforms to the rules for a SURF name token.
      static boolean isTokenBeginCharacter​(int c)
      Determines if the given character is a SURF token name begin character.
      static boolean isTokenCharacter​(int c)
      Determines if the given character is a SURF name token character.
      static boolean isValid​(java.lang.String string)
      Determines whether the given string conforms to the rules for a SURF name.
      static boolean isValidToken​(java.lang.String string)
      Determines whether the given string conforms to the rules for a SURF name token.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TOKEN_PATTERN

        public static final java.util.regex.Pattern TOKEN_PATTERN
        Regular expression pattern to match a SURF name token .
      • PATTERN

        public static final java.util.regex.Pattern PATTERN
        A SURF name is a single name token.
    • Constructor Detail

      • Name

        public Name()
    • Method Detail

      • isValidToken

        public static boolean isValidToken​(java.lang.String string)
        Determines whether the given string conforms to the rules for a SURF name token.
        Parameters:
        string - The string to test.
        Returns:
        true if the string is a valid URF name token.
        Throws:
        java.lang.NullPointerException - if the given string is null.
        See Also:
        TOKEN_PATTERN
      • checkArgumentValidToken

        public static java.lang.String checkArgumentValidToken​(java.lang.String string)
        Confirms that the given string conforms to the rules for a SURF name token.
        Parameters:
        string - The string to check.
        Returns:
        The given string.
        Throws:
        java.lang.NullPointerException - if the given string is null.
        java.lang.IllegalArgumentException - if the given string does not conform to the rules for a SURF name token.
        See Also:
        TOKEN_PATTERN
      • isTokenBeginCharacter

        public static final boolean isTokenBeginCharacter​(int c)
        Determines if the given character is a SURF token name begin character. A name token begin character is a Unicode letter.
        Parameters:
        c - The character to check.
        Returns:
        true if the character is a SURF name begin character.
      • isTokenCharacter

        public static final boolean isTokenCharacter​(int c)
        Determines if the given character is a SURF name token character. A name token character is a Unicode letter, mark, number, or connector punctuation.
        Parameters:
        c - The character to check.
        Returns:
        true if the character is a SURF name character.
      • isValid

        public static boolean isValid​(java.lang.String string)
        Determines whether the given string conforms to the rules for a SURF name.
        Parameters:
        string - The string to test.
        Returns:
        true if the string is a valid SURF name.
        Throws:
        java.lang.NullPointerException - if the given string is null.
        See Also:
        PATTERN
      • checkArgumentValid

        public static java.lang.String checkArgumentValid​(java.lang.String string)
        Confirms that the given string conforms to the rules for a SURF name.
        Parameters:
        string - The string to check.
        Returns:
        The given string.
        Throws:
        java.lang.NullPointerException - if the given string is null.
        java.lang.IllegalArgumentException - if the given string does not conform to the rules for a SURF name.
        See Also:
        PATTERN