com.vaadin.shared.ui.dnd.criteria.
Class Payload
- java.lang.Object
-
- com.vaadin.shared.ui.dnd.criteria.Payload
-
All Implemented Interfaces:
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:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Payload.ValueType
Type of the payload's value.
-
Field Summary
Fields Modifier and Type Field Description static String
ITEM_PREFIX
Prefix of the payload data type.
-
Constructor Summary
Constructors Constructor Description Payload(String key, String value, Payload.ValueType valueType)
Creates a payload object.
-
Method Summary
All Methods Modifier and Type Method Description String
getKey()
Gets the key of this payload.
String
getPayloadString()
Returns the string representation of this payload.
String
getValue()
Gets the value of this payload.
Payload.ValueType
getValueType()
Gets the value type of this payload.
static Payload
parse(String payloadString)
Parses a payload string and returns a payload object represented by that string.
void
setKey(String key)
Sets the key of this payload.
void
setValue(String value)
Sets the value of this payload.
void
setValueType(Payload.ValueType valueType)
Sets the value type of this payload.
-
-
-
Field Detail
-
ITEM_PREFIX
public static final String ITEM_PREFIX
Prefix of the payload data type.
See Also:
-
-
Constructor Detail
-
Payload
public Payload(String key, String value, Payload.ValueType valueType)
Creates a payload object.
Parameters:
key
- key of the payloadvalue
- value of the payloadvalueType
- 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
-
-