T - The runtime type of the underlying boolean values.public final class BooleanConfigType<T> extends ConfigType<T,Boolean,BooleanSerializableType>
deserializer, serializer| Constructor and Description |
|---|
BooleanConfigType(Class<T> actualType,
Function<Boolean,T> deserializer,
Function<T,Boolean> serializer) |
| Modifier and Type | Method and Description |
|---|---|
BooleanConfigType<T> |
constrain(ConstraintAnnotationProcessor<Annotation> processor,
Annotation annotation,
AnnotatedElement annotated)
Applies the constraints defined by the given constraint annotation.
|
<U> BooleanConfigType<U> |
derive(Class<? super U> runtimeType,
Function<T,U> partialDeserializer,
Function<U,T> partialSerializer)
Derive a
ConfigType from this type object. |
ConfigType<T,Boolean,BooleanSerializableType> |
withType(BooleanSerializableType newSpec)
Replace the current serialized type used for specification with the given serialized type.
|
getRuntimeType, getSerializedType, toPlatformType, toRuntimeType, toSerializedType, toStringpublic <U> BooleanConfigType<U> derive(Class<? super U> runtimeType, Function<T,U> partialDeserializer, Function<U,T> 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<T,Boolean,BooleanSerializableType>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 ConfigType<T,Boolean,BooleanSerializableType> withType(BooleanSerializableType newSpec)
ConfigTypewithType in class ConfigType<T,Boolean,BooleanSerializableType>newSpec - The new type specification.SerializableType.isAssignableFrom(SerializableType)public BooleanConfigType<T> constrain(ConstraintAnnotationProcessor<Annotation> processor, Annotation annotation, AnnotatedElement annotated)
ConfigTypeconstrain in class ConfigType<T,Boolean,BooleanSerializableType>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.