Class CompatibleTypeUtils

java.lang.Object
org.apache.dubbo.common.utils.CompatibleTypeUtils

public class CompatibleTypeUtils extends Object
  • Method Details

    • compatibleTypeConvert

      public static Object compatibleTypeConvert(Object value, Class<?> type)
      Compatible type convert. Null value is allowed to pass in. If no conversion is needed, then the original value will be returned.

      Supported compatible type conversions include (primary types and corresponding wrappers are not listed):

      • String -> char, enum, Date
      • byte, short, int, long -> byte, short, int, long
      • float, double -> float, double