Enum PayloadType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PayloadType>

    public enum PayloadType
    extends java.lang.Enum<PayloadType>
    enum for dealing with Payload types. Used in code generation for mapping between payload type names, java class names, and accessor names.
    • Field Detail

      • payloadTypeName

        @Nonnull
        public final java.lang.String payloadTypeName
      • javaClassName

        @Nonnull
        public final java.lang.String javaClassName
      • javascriptTypeName

        @Nonnull
        public final java.lang.String javascriptTypeName
      • javaAccessorName

        @Nonnull
        public final java.lang.String javaAccessorName
    • Method Detail

      • values

        public static PayloadType[] 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 (PayloadType c : PayloadType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PayloadType 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
      • payloadHasThisType

        @Deprecated
        public boolean payloadHasThisType​(@Nullable
                                          Payload payload)
        Deprecated.
        use Payload.hasType
        See whether a given Payload has a specified type. This could also be done with introspection, and might belong in the Payload bean itself.
        Parameters:
        payload - A payload
        Returns:
        true if the payload has the type
      • getDefaultJavascriptValue

        public java.lang.String getDefaultJavascriptValue()
      • payloadTypeForName

        @Nonnull
        public static PayloadType payloadTypeForName​(@Nonnull
                                                     java.lang.String payloadTypeName)
                                              throws java.lang.IllegalArgumentException
        Given a Payload field name, return its corresponding PayloadType.
        Parameters:
        payloadTypeName - a string of payload type
        Returns:
        null if it isn't an existing field name.
        Throws:
        java.lang.IllegalArgumentException
      • payloadTypeForValue

        @Nonnull
        public static PayloadType payloadTypeForValue​(@Nullable
                                                      java.lang.Object payloadValue)
                                               throws java.lang.IllegalArgumentException
        Flexible method for determining payload type from a value - helpful for determining the schema of map payload types
        Parameters:
        payloadValue - a payload value
        Returns:
        the payload type determined from the given value
        Throws:
        java.lang.IllegalArgumentException - if type cannot be determined
      • allTypeNames

        @Nonnull
        public static java.util.List<java.lang.String> allTypeNames()
        For printing useful error messages, the proctor webapp, and for testing.
        Returns:
        all types name
      • isArrayType

        public boolean isArrayType()