Class TypeConverters.ByteArrayConverter

  • All Implemented Interfaces:
    TypeConverter<byte[]>
    Enclosing class:
    TypeConverters

    @Plugin(name="ByteArray",
            category="TypeConverter")
    public static class TypeConverters.ByteArrayConverter
    extends java.lang.Object
    implements TypeConverter<byte[]>
    Converts a String into a byte[]. The supported formats are:
    • 0x0123456789ABCDEF
    • Base64:ABase64String
    • String using Charset.defaultCharset() [TODO Should this be UTF-8 instead?]
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String PREFIX_0x  
      private static java.lang.String PREFIX_BASE64  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] convert​(java.lang.String value)
      Converts a String to a given type.
      • Methods inherited from class java.lang.Object

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

      • ByteArrayConverter

        public ByteArrayConverter()
    • Method Detail

      • convert

        public byte[] convert​(java.lang.String value)
        Description copied from interface: TypeConverter
        Converts a String to a given type.
        Specified by:
        convert in interface TypeConverter<byte[]>
        Parameters:
        value - the String to convert. Cannot be null.
        Returns:
        the converted object.