Class ReadableBytesTypeConverter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<ReadableBytes> annotationType()  
      java.util.Optional<java.lang.Number> convert​(java.lang.CharSequence object, java.lang.Class<java.lang.Number> targetType, ConversionContext context)
      Converts from the given source object type to the target type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReadableBytesTypeConverter

        public ReadableBytesTypeConverter()
    • Method Detail

      • convert

        public java.util.Optional<java.lang.Number> convert​(java.lang.CharSequence object,
                                                            java.lang.Class<java.lang.Number> targetType,
                                                            ConversionContext context)
        Description copied from interface: TypeConverter
        Converts from the given source object type to the target type. Implementers should take care to return Optional.empty() in case the object is not convertible by catching any necessary exceptions and failing gracefully.
        Specified by:
        convert in interface TypeConverter<java.lang.CharSequence,​java.lang.Number>
        Parameters:
        object - The object type
        targetType - The target type being converted to
        context - The ConversionContext
        Returns:
        The converted type or empty if the conversion is not possible