Class Convert


  • class Convert
    extends Object
    This class is considered internal to the package.
    • Constructor Detail

      • Convert

        Convert()
    • Method Detail

      • toVariant

        public static Variant.VARIANT toVariant​(Object value)
        Convert a java value into a VARIANT suitable for passing in a COM invocation.

        Implementation notes

        Parameters:
        value - to be wrapped
        Returns:
        wrapped VARIANT
      • toComEnum

        public static <T extends IComEnum> T toComEnum​(Class<T> enumType,
                                                       Object value)
      • free

        public static void free​(Variant.VARIANT variant,
                                Class<?> javaType)
        Free the contents of the supplied VARIANT.

        This method is a companion to toVariant(java.lang.Object). Primary usage is to free BSTRs contained in VARIANTs.

        Parameters:
        variant - to be cleared
        javaType - type before/after conversion
      • free

        public static void free​(Variant.VARIANT variant,
                                Object value)
        Free the contents of the supplied VARIANT.

        This method is a companion to toVariant(java.lang.Object). Primary usage is to free BSTRs contained in VARIANTs.

        Parameters:
        variant - to be cleared
        value - value before/after conversion