Interface DynamicMetadataField
-
public interface DynamicMetadataField
Represents a single DynamicMetadataField.- Since:
- 4.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getLabel()
Get the label of this field.java.lang.String
getName()
Get the name of this asset.java.util.List<FieldItem>
getPossibleFieldItems()
Gets all possible field items for a checkbox, radio or dropdown field.java.util.List<FieldItem>
getSelectedFieldItems()
Gets all selected field items for a checkbox, radio or dropdown field.java.lang.String
getValue()
Returns the value of this dynamic metadata field.java.lang.String[]
getValues()
Get the value(s) of this field, possibly empty, never null.boolean
hasValue(java.lang.String value)
boolean
isCheckbox()
If this field is a checkboxboolean
isDatetime()
boolean
isDropdown()
If this field is a dropdownboolean
isMultiselect()
If this field is a multiselect.boolean
isRadio()
If this field is a radio button.void
setName(java.lang.String newName)
Set the asset's namevoid
setValue(java.lang.String value)
Sets the value of this DynamicaMetadataField.void
setValues(java.util.List<java.lang.String> values)
Sets the values of this DynamicMetadataField.
-
-
-
Method Detail
-
getLabel
java.lang.String getLabel()
Get the label of this field.- Returns:
-
getValue
java.lang.String getValue()
Returns the value of this dynamic metadata field. If this field can have multiple values, only the first is returned. Use getValues() if you need all values.- Returns:
- returns a String or null if this field has no value
-
getValues
java.lang.String[] getValues()
Get the value(s) of this field, possibly empty, never null. If isRadio() == true or isDropdown() == true and isMultiple() == false, this can only have one value. Otherwise it could have multiple items.- Returns:
- an array of String values for this field; these are the values that have been set.
-
isCheckbox
boolean isCheckbox()
If this field is a checkbox- Returns:
- true if this field represents a checkbox field
-
isDropdown
boolean isDropdown()
If this field is a dropdown- Returns:
- true if this field represents a dropdown field
-
isRadio
boolean isRadio()
If this field is a radio button.- Returns:
- true if this field corresponds to a radio button, false otherwise
-
isMultiselect
boolean isMultiselect()
If this field is a multiselect.- Returns:
- true if this field represents a multiselect field
-
isDatetime
boolean isDatetime()
- Returns:
- Returns true if this field is a datetime field
-
setValue
void setValue(java.lang.String value)
Sets the value of this DynamicaMetadataField.- Parameters:
value
- the value to set
-
setValues
void setValues(java.util.List<java.lang.String> values)
Sets the values of this DynamicMetadataField.- Parameters:
values
-
-
getName
java.lang.String getName()
Get the name of this asset.- Returns:
- the current name of this asset
-
setName
void setName(java.lang.String newName)
Set the asset's name- Parameters:
newName
- the new name
-
hasValue
boolean hasValue(java.lang.String value)
- Parameters:
value
- A value to check- Returns:
- Returns true if getValues() contains given
value
.
-
getPossibleFieldItems
java.util.List<FieldItem> getPossibleFieldItems()
Gets all possible field items for a checkbox, radio or dropdown field.- Returns:
- The possible field items, or empty list if the field is not a checkbox, radio or dropdown field.
-
getSelectedFieldItems
java.util.List<FieldItem> getSelectedFieldItems()
Gets all selected field items for a checkbox, radio or dropdown field.- Returns:
- The selected field items, or empty list if the field is not a checkbox, radio or dropdown field.
-
-