R - The runtime type of the underlying ConfigBranch value.public final class RecordConfigType<R> extends ConfigType<R,Map<String,Object>,RecordSerializableType>
ConfigType for fixed heterogeneous records. This is typically used to store POJOs or tuples,
but may be used for any parametric serialized form.deserializer, serializer| Constructor and Description |
|---|
RecordConfigType(RecordSerializableType serializedType,
Class<? super R> runtimeType,
Function<Map<String,Object>,R> f,
Function<R,Map<String,Object>> f0) |
| Modifier and Type | Method and Description |
|---|---|
RecordConfigType<R> |
constrain(ConstraintAnnotationProcessor<Annotation> processor,
Annotation annotation,
AnnotatedElement annotated)
Applies the constraints defined by the given constraint annotation.
|
<U> RecordConfigType<U> |
derive(Class<? super U> runtimeType,
Function<R,U> partialDeserializer,
Function<U,R> partialSerializer)
Derive a
ConfigType from this type object. |
String |
toString() |
RecordConfigType<R> |
withType(RecordSerializableType newSpec)
Replace the current serialized type used for specification with the given serialized type.
|
getRuntimeType, getSerializedType, toPlatformType, toRuntimeType, toSerializedTypepublic <U> RecordConfigType<U> derive(Class<? super U> runtimeType, Function<R,U> partialDeserializer, Function<U,R> partialSerializer)
ConfigTypeConfigType from this type object.
The new ConfigType will have the same serialized type (with the same constraints),
but a different runtime type. Values will be converted between the two
types using composed functions: toSerializedType(x) = this.toSerializedType(partialSerializer(x))
and toRuntimeType(y) = partialDeserializer(this.toRuntimeType(y)).
derive in class ConfigType<R,Map<String,Object>,RecordSerializableType>U - the runtime type of the new ConfigTyperuntimeType - a class object representing the runtime type of the new ConfigTypepartialDeserializer - a partial deserialization functionpartialSerializer - a partial serialization functionConfigType with the given runtimeTypepublic RecordConfigType<R> withType(RecordSerializableType newSpec)
ConfigTypewithType in class ConfigType<R,Map<String,Object>,RecordSerializableType>newSpec - The new type specification.SerializableType.isAssignableFrom(SerializableType)public RecordConfigType<R> constrain(ConstraintAnnotationProcessor<Annotation> processor, Annotation annotation, AnnotatedElement annotated)
ConfigTypeconstrain in class ConfigType<R,Map<String,Object>,RecordSerializableType>processor - The processor for constraints of this type.annotation - The annotation from which to extract constraints.annotated - The annotated element. For example, a field in a POJO.public String toString()
toString in class ConfigType<R,Map<String,Object>,RecordSerializableType>