Enum Class UserProfileStringURNType

java.lang.Object
java.lang.Enum<UserProfileStringURNType>
com.iizix.urn.user.UserProfileStringURNType
All Implemented Interfaces:
Serializable, Comparable<UserProfileStringURNType>, Constable

public enum UserProfileStringURNType extends Enum<UserProfileStringURNType>
Possible query values for the {@link UserProfileStringURN}. Note that some query values can be indexed.
Author:
Christopher Mindus
  • Enum Constant Details

  • Field Details

    • detail

      public final String detail
      The DETAIL string for the User Details without any additional suffix for a potential numbered one-based value. Numbered values are only allowed when the member {@link #multiple} is true.
      See Also:
    • multiple

      public final boolean multiple
      Boolean flag indicating the "details" string can be appended with "-nn", where "nn" is a number between 1 and 99, used when e.g. multiple phone numbers are present. When the value "nn" is one, nothing is appended (i.e. "-1" is not appended to the detail string).
      See Also:
  • Method Details

    • values

      public static UserProfileStringURNType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UserProfileStringURNType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue(int nn)
      Gets the variation of a 2nd or up to 99th value. The nn value preceded by an underscore is appended to the {@link #name()} of the enum value, e.g. WorkMobile<strong>_2</strong>.
      Parameters:
      nn - The nn value requested. If zero or one is specified, the original name is returned (if "one", multiple values support will throw an IllegalStateException).
      Throws:
      IllegalArgumentException - If the value is less than 0 or larger than 99.
      IllegalStateException - If the query string does not support multiple values.
    • getDetail

      public String getDetail(int nn)
      Gets the variation of a 2nd or up to 99th details for the database DETAIL query.
      Parameters:
      nn - The nn details value requested. If zero or one is specified, the original name is returned (if "one", multiple values support will throw an IllegalStateException).
      Throws:
      IllegalArgumentException - If the details value is less than 0 or larger than 99.
      IllegalStateException - If the query string does not support multiple details values.
    • fromQuery

      public static UserProfileStringURNType fromQuery(String query)
      Gets the URN Profile User query from a string, case insensitive, without support for multiple values, the match with "enum" values in this class must match precisely.
      Parameters:
      query - The URN Profile User String query.
      Returns:
      The UserProfileStringURNQuery instance, or null if not found.
    • fromQuery

      public static UserProfileStringURNType fromQuery(String query, int[] oneBasedIndex)
      Gets the URN Profile User String query from a string, case insensitive. If the URN Profile User String query supports multiple values (appended as "" or "_1" for the first value, "_2" for the second, and so on), the oneBasedIndex will return the one-based index value. The value cannot exceed 99.
      Parameters:
      query - The URN Profile User String query.
      oneBasedIndex - The one-based index of the query name is returned in this variable. If non-null, this array should be at least one in length, where the returned value is placed in index zero. Upon return, this index value zero will be set to zero if the URN Profile User query does not support multiple values, otherwise it will be set to a value between 1 and 99.
      Returns:
      The UserProfileStringURNQuery instance, or null if not found.
      Throws:
      NullPointerException - If the URN Profile User String query results in an indexed value and oneBasedIndex is set to null.