Package io.urf.surf

Class SURF.Handle

  • Enclosing class:
    SURF

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

      Fields 
      Modifier and Type Field Description
      static java.util.regex.Pattern PATTERN
      Regular expression pattern to match a SURF handle.
      static char SEGMENT_DELIMITER
      The delimiter used to separate segments of a SURF handle.
    • Constructor Summary

      Constructors 
      Constructor Description
      Handle()  
    • 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 handle.
      static boolean isBeginCharacter​(int c)
      Determines if the given character is valid to begin a SURF handle.
      static boolean isValid​(java.lang.String string)
      Determines whether the given string conforms to the rules for a SURF handle.
      • Methods inherited from class java.lang.Object

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

      • SEGMENT_DELIMITER

        public static final char SEGMENT_DELIMITER
        The delimiter used to separate segments of a SURF handle.
        See Also:
        Constant Field Values
      • PATTERN

        public static final java.util.regex.Pattern PATTERN
        Regular expression pattern to match a SURF handle.
    • Constructor Detail

      • Handle

        public Handle()
    • Method Detail

      • isBeginCharacter

        public static final boolean isBeginCharacter​(int c)
        Determines if the given character is valid to begin a SURF handle. A SURF handle begins with a name token.
        Parameters:
        c - The character to check.
        Returns:
        true if the character is a SURF handle begin character.
        See Also:
        SURF.Name.isTokenBeginCharacter(int)
      • isValid

        public static boolean isValid​(java.lang.String string)
        Determines whether the given string conforms to the rules for a SURF handle.
        Parameters:
        string - The string to test.
        Returns:
        true if the string is a valid SURF handle.
        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 handle.
        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 handle.
        See Also:
        PATTERN