Class CustomMetadataFieldCreateParams.Schema.DefaultValue
-
- All Implemented Interfaces:
public final class CustomMetadataFieldCreateParams.Schema.DefaultValueThe default value for this custom metadata field. This property is only required if
isValueRequiredproperty is set totrue. The value should match thetypeof custom metadata field.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCustomMetadataFieldCreateParams.Schema.DefaultValue.VisitorAn interface that defines how to map each variant of DefaultValue to a value of type T.
public final classCustomMetadataFieldCreateParams.Schema.DefaultValue.DefaultValueItem
-
Method Summary
-
-
Method Detail
-
mixed
final Optional<List<CustomMetadataFieldCreateParams.Schema.DefaultValue.DefaultValueItem>> mixed()
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
asMixed
final List<CustomMetadataFieldCreateParams.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(CustomMetadataFieldCreateParams.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 CustomMetadataFieldCreateParams.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 CustomMetadataFieldCreateParams.Schema.DefaultValue ofString(String string)
-
ofNumber
final static CustomMetadataFieldCreateParams.Schema.DefaultValue ofNumber(Double number)
-
ofBool
final static CustomMetadataFieldCreateParams.Schema.DefaultValue ofBool(Boolean bool)
-
ofMixed
final static CustomMetadataFieldCreateParams.Schema.DefaultValue ofMixed(List<CustomMetadataFieldCreateParams.Schema.DefaultValue.DefaultValueItem> mixed)
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
-
-
-