Class CustomMetadataFieldUpdateParams.Schema.DefaultValue
-
- All Implemented Interfaces:
public final class CustomMetadataFieldUpdateParams.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 interfaceCustomMetadataFieldUpdateParams.Schema.DefaultValue.VisitorAn interface that defines how to map each variant of DefaultValue to a value of type T.
public final classCustomMetadataFieldUpdateParams.Schema.DefaultValue.DefaultValueItem
-
Method Summary
-
-
Method Detail
-
mixed
final Optional<List<CustomMetadataFieldUpdateParams.Schema.DefaultValue.DefaultValueItem>> mixed()
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
asMixed
final List<CustomMetadataFieldUpdateParams.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(CustomMetadataFieldUpdateParams.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 CustomMetadataFieldUpdateParams.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 CustomMetadataFieldUpdateParams.Schema.DefaultValue ofString(String string)
-
ofNumber
final static CustomMetadataFieldUpdateParams.Schema.DefaultValue ofNumber(Double number)
-
ofBool
final static CustomMetadataFieldUpdateParams.Schema.DefaultValue ofBool(Boolean bool)
-
ofMixed
final static CustomMetadataFieldUpdateParams.Schema.DefaultValue ofMixed(List<CustomMetadataFieldUpdateParams.Schema.DefaultValue.DefaultValueItem> mixed)
Default value should be of type array when custom metadata field type is set to
MultiSelect.
-
-
-
-