Enum ScriptType

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int id
      Deprecated.
      Use numericId() or better yet use id() to get a script identifier string
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.util.Optional<ScriptType> find​(java.lang.String id)
      Use this method to create a ScriptType from a script identifier string that should be validated.
      java.lang.String id()
      Return the script identifier string for this ScriptType.
      int numericId()
      Deprecated.
      Using id() to get a script identifier string is preferred.
      static ScriptType of​(java.lang.String id)
      Use this method to create a ScriptType from a known good script identifier string.
      static ScriptType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ScriptType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • id

        @Deprecated
        public final int id
        Deprecated.
        Use numericId() or better yet use id() to get a script identifier string
    • Method Detail

      • values

        public static ScriptType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ScriptType c : ScriptType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ScriptType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        public static ScriptType of​(java.lang.String id)
        Use this method to create a ScriptType from a known good script identifier string.
        Parameters:
        id - A script identifier string
        Returns:
        the script type
        Throws:
        java.lang.IllegalArgumentException - if unknown/invalid script identifier string
      • find

        public static java.util.Optional<ScriptType> find​(java.lang.String id)
        Use this method to create a ScriptType from a script identifier string that should be validated.
        Parameters:
        id - A script identifier string
        Returns:
        A ScriptType-containing Optional or Optional.empty()
      • id

        public java.lang.String id()
        Return the script identifier string for this ScriptType.

        Be careful: the id() method returns a different type and value than what is in the deprecated id field.

        Returns:
        A script identifier string
      • numericId

        @Deprecated
        public int numericId()
        Deprecated.
        Using id() to get a script identifier string is preferred.
        This is deprecated. But less deprecated than accessing the id field directly.
        Returns:
        A numeric ID