class IeSinglePointWithQualityConverter extends CustomConverter<IeSinglePointWithQuality, BitmaskMeasurementElementDto> {

    @Override
    public BitmaskMeasurementElementDto convert(final IeSinglePointWithQuality source,
            final Type<? extends BitmaskMeasurementElementDto> destinationType, final MappingContext mappingContext) {
        int value = 0;
        value += source.isOn() ? BIT_ON : 0;
        value += source.isBlocked() ? BIT_BLOCKED : 0;
        value += source.isSubstituted() ? BIT_SUBSTITUTED : 0;
        value += source.isNotTopical() ? BIT_NOT_TOPICAL : 0;
        value += source.isInvalid() ? BIT_INVALID : 0;
        return new BitmaskMeasurementElementDto((byte) value);
    }

}