Interface IRecordValueDescriptor
- All Superinterfaces:
IAttributeConfigurable<IValueDescriptor<Map<String,?>, IRecordValueBuilder>>, IValueDescriptor<Map<String, ?>, IRecordValueBuilder>, Serializable
- All Known Implementing Classes:
AttachmentDescriptor, FileItemDescriptor, FormRecordChatDescriptor, FormRecordMessageDescriptor, FormRecordMessageUploadRequestDescriptor, MimeTypeDescriptor, RecordValueDescriptorWrapper, UserDataDescriptor, UserProfileDescriptor
public interface IRecordValueDescriptor
extends IValueDescriptor<Map<String,?>, IRecordValueBuilder>
A
IValueDescriptor for a record value, i.e. a Map with a certain shape. Compared with a
IMapValueDescriptor, a record value (a) always only contains a finite set of known properties and cannot have
arbitrary properties; and (b) may have a different type for each property. Note that only the defined properties are
allowed, undefined extraneous properties are forbidden.-
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder pre-configured with the settings of this descriptor.default EValueTypeGets the basic type of the value described by this value descriptor.Gets the Java class of the values described by this descriptor.Map<String, IRecordMember<?, ?>> withAddedAttribute(String key, Object value) Gets a new instance with the attribute at the given key changed to the given value.withAddedAttributes(Map<String, Object> newAttributes) Gets a new instance with the attributes changed to the given map of attributes.withAttributes(Map<String, Object> attributes) Gets a new instance with the attributes changed to the given map of attributes.withDefaultValue(Object defaultValue) Gets a new value descriptor with the default value changed to the given value.withDescription(String description) Deprecated.Methods inherited from interface IAttributeConfigurable
getAttribute, getAttribute, getBooleanAttribute, getBooleanAttribute, getFloatAttribute, getFloatAttribute, getIntegerAttribute, getIntegerAttribute, getStringAttribute, getStringAttributeMethods inherited from interface IValueDescriptor
acceptsValue, acceptsValue, asAny, asBoolean, asConst, asFloat, asInteger, asLargeString, asList, asList, asMap, asMap, asNull, asRecord, asString, asTuple, asUnion, asUnion, asVoid, builder, builder, getAttributes, getDefaultValue, getDescription, getFullType, getFullTypeWithRestrictions, getKnownProperties, getKnownProperties, intersect, is, match, unwrap
-
Method Details
-
configure
IRecordValueDescriptorBuilder configure()Description copied from interface:IValueDescriptorCreates a new builder pre-configured with the settings of this descriptor. Lets you e.g. add additional properties.- Specified by:
configurein interfaceIValueDescriptor<Map<String,?>, IRecordValueBuilder> - Returns:
- A new builder pre-configured with the settings of this descriptor.
-
getBaseType
Description copied from interface:IValueDescriptorGets the basic type of the value described by this value descriptor.- Specified by:
getBaseTypein interfaceIValueDescriptor<Map<String,?>, IRecordValueBuilder> - Returns:
- The value's basic type.
-
getJavaClass
Description copied from interface:IValueDescriptorGets the Java class of the values described by this descriptor.- Specified by:
getJavaClassin interfaceIValueDescriptor<Map<String,?>, IRecordValueBuilder> - Returns:
- The value's Java class.
-
getRecordValueDescriptors
Map<String, IRecordMember<?,?>> getRecordValueDescriptors()- Returns:
- A map of all properties the record may have, mapped to the value descriptor for each property.
-
withAddedAttribute
Description copied from interface:IAttributeConfigurableGets a new instance with the attribute at the given key changed to the given value.- Specified by:
withAddedAttributein interfaceIAttributeConfigurable<IValueDescriptor<Map<String,?>, IRecordValueBuilder>> - Parameters:
key- The attribute key.value- The attribute value.- Returns:
- A new instance with the new attribute.
-
withAddedAttributes
Description copied from interface:IAttributeConfigurableGets a new instance with the attributes changed to the given map of attributes. Preserves other existing attributes and only adds or replaces the given ones.- Specified by:
withAddedAttributesin interfaceIAttributeConfigurable<IValueDescriptor<Map<String,?>, IRecordValueBuilder>> - Parameters:
newAttributes- The new attributes to add (or replace).- Returns:
- A new instance with the current attributes plus the given attributes.
-
withAttributes
Description copied from interface:IAttributeConfigurableGets a new instance with the attributes changed to the given map of attributes. Replaces all existing attributes.- Specified by:
withAttributesin interfaceIAttributeConfigurable<IValueDescriptor<Map<String,?>, IRecordValueBuilder>> - Parameters:
attributes- The new attributes.- Returns:
- A new instance with the given attributes.
-
withDefaultValue
Description copied from interface:IValueDescriptorGets a new value descriptor with the default value changed to the given value.- Specified by:
withDefaultValuein interfaceIValueDescriptor<Map<String,?>, IRecordValueBuilder> - Parameters:
defaultValue- The new default value. May be changed when it does not conform to the restrictions imposed by this descriptor.- Returns:
- A new descriptor with the default value.
-
withDescription
Deprecated.Description copied from interface:IValueDescriptorGets a new value descriptor with the description changed to the given description.- Specified by:
withDescriptionin interfaceIValueDescriptor<Map<String,?>, IRecordValueBuilder> - Parameters:
description- The new description.- Returns:
- A new descriptor with the given description.
-