Class StringByteSizeConverter

java.lang.Object
com.fasterxml.jackson.databind.util.StdConverter<String,Long>
nl.knaw.dans.convert.jackson.StringByteSizeConverter
All Implemented Interfaces:
com.fasterxml.jackson.databind.util.Converter<String,Long>

public class StringByteSizeConverter extends com.fasterxml.jackson.databind.util.StdConverter<String,Long>
Converts a string representation of a byte size to a long. The string can be a number, optionally followed by a suffix indicating the unit. The following suffixes are supported:
  • K or KB for kilobytes
  • M or MB for megabytes
  • G or GB for gigabytes
  • T or TB for terabytes
If no suffix is provided, the number is interpreted as bytes.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.util.Converter

    com.fasterxml.jackson.databind.util.Converter.None
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     

    Methods inherited from class com.fasterxml.jackson.databind.util.StdConverter

    _findConverterType, getInputType, getOutputType

    Methods inherited from class java.lang.Object

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

    • StringByteSizeConverter

      public StringByteSizeConverter()
  • Method Details

    • convert

      public Long convert(String s)
      Specified by:
      convert in interface com.fasterxml.jackson.databind.util.Converter<String,Long>
      Specified by:
      convert in class com.fasterxml.jackson.databind.util.StdConverter<String,Long>