Class Payload

  • All Implemented Interfaces:
    Serializable

    public class Payload
    extends Object
    implements Serializable
    Stores key/value pairs and the value type. Payload is set in DragSourceExtension and is transferred during drag operation. It is used for comparing values to acceptance criteria.
    Since:
    8.1
    See Also:
    Serialized Form
    • Constructor Detail

      • Payload

        public Payload​(String key,
                       String value,
                       Payload.ValueType valueType)
        Creates a payload object.
        Parameters:
        key - key of the payload
        value - value of the payload
        valueType - type of the payload value
    • Method Detail

      • getKey

        public String getKey()
        Gets the key of this payload.
        Returns:
        key identifying this payload
      • setKey

        public void setKey​(String key)
        Sets the key of this payload.
        Parameters:
        key - key that identifies the payload
      • getValue

        public String getValue()
        Gets the value of this payload.
        Returns:
        value of this payload
      • setValue

        public void setValue​(String value)
        Sets the value of this payload.
        Parameters:
        value - value of the payload
      • getValueType

        public Payload.ValueType getValueType()
        Gets the value type of this payload.
        Returns:
        the type of the value of this payload
      • setValueType

        public void setValueType​(Payload.ValueType valueType)
        Sets the value type of this payload.
        Parameters:
        valueType - type of the payload value
      • getPayloadString

        public String getPayloadString()
        Returns the string representation of this payload. It is used as the data type in the DataTransfer object.
        Returns:
        the string representation of this payload
      • parse

        public static Payload parse​(String payloadString)
        Parses a payload string and returns a payload object represented by that string.
        Parameters:
        payloadString - string that represents a payload object
        Returns:
        a payload object represented by the given string