Class JavaTypeConverter

java.lang.Object
com.evolveum.midpoint.prism.util.JavaTypeConverter

public class JavaTypeConverter extends Object
Generic universal type converter. It is supposed to covert anything to anything as long as there is any way to convert it. This means converting string containing a decimal representation of a number to int, PolyString to string, etc. This is supposed to work in a fashion similar to many scripting languages (e.g. perl) where the programmer does not really care about the type and the type conversion is done automatically.

TODO clean this up as it is now part of prism-api!

Author:
Radovan Semancik
  • Constructor Details

    • JavaTypeConverter

      public JavaTypeConverter()
  • Method Details

    • convert

      public static <T> T convert(Class<T> expectedType, Object rawValue)
    • convert

      public static Object convert(Class<?> expectedType, Object rawValue, boolean failIfImpossible)
    • isTypeCompliant

      public static <T> boolean isTypeCompliant(@Nullable T value, @Nullable @Nullable Class<?> expectedClass)