Class CustomMetadataField.Schema.DefaultValue
-
- All Implemented Interfaces:
public final class CustomMetadataField.Schema.DefaultValueThe default value for this custom metadata field. Data type of default value depends on the field type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCustomMetadataField.Schema.DefaultValue.VisitorAn interface that defines how to map each variant of DefaultValue to a value of type T.
public final classCustomMetadataField.Schema.DefaultValue.DefaultValueItem
-
Method Summary
Modifier and Type Method Description final Optional<String>string()final Optional<Double>number()final Optional<Boolean>bool()final Optional<List<CustomMetadataField.Schema.DefaultValue.DefaultValueItem>>mixed()Default value should be of type array when custom metadata field type is set to MultiSelect.final BooleanisString()final BooleanisNumber()final BooleanisBool()final BooleanisMixed()final StringasString()final DoubleasNumber()final BooleanasBool()final List<CustomMetadataField.Schema.DefaultValue.DefaultValueItem>asMixed()Default value should be of type array when custom metadata field type is set to MultiSelect.final Optional<JsonValue>_json()final <T extends Any> Taccept(CustomMetadataField.Schema.DefaultValue.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final CustomMetadataField.Schema.DefaultValuevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static CustomMetadataField.Schema.DefaultValueofString(String string)final static CustomMetadataField.Schema.DefaultValueofNumber(Double number)final static CustomMetadataField.Schema.DefaultValueofBool(Boolean bool)final static CustomMetadataField.Schema.DefaultValueofMixed(List<CustomMetadataField.Schema.DefaultValue.DefaultValueItem> mixed)Default value should be of type array when custom metadata field type is set to MultiSelect.-
-
Method Detail
-
mixed
final Optional<List<CustomMetadataField.Schema.DefaultValue.DefaultValueItem>> mixed()
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
asMixed
final List<CustomMetadataField.Schema.DefaultValue.DefaultValueItem> asMixed()
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
accept
final <T extends Any> T accept(CustomMetadataField.Schema.DefaultValue.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import io.imagekit.core.JsonValue; import java.util.Optional; Optional<String> result = defaultValue.accept(new DefaultValue.Visitor<Optional<String>>() { @Override public Optional<String> visitString(String string) { return Optional.of(string.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final CustomMetadataField.Schema.DefaultValue validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofString
final static CustomMetadataField.Schema.DefaultValue ofString(String string)
-
ofNumber
final static CustomMetadataField.Schema.DefaultValue ofNumber(Double number)
-
ofBool
final static CustomMetadataField.Schema.DefaultValue ofBool(Boolean bool)
-
ofMixed
final static CustomMetadataField.Schema.DefaultValue ofMixed(List<CustomMetadataField.Schema.DefaultValue.DefaultValueItem> mixed)
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
-
-
-