Class MapiTypeConverterMapEntry

    • Constructor Detail

      • MapiTypeConverterMapEntry

        public MapiTypeConverterMapEntry​(Class<?> type)
        Initializes a new instance of the MapiTypeConverterMapEntry class.
        Parameters:
        type - The type. y default, converting a type to string is done by calling value.ToString. Instances can override this behavior. By default, converting a string to the appropriate value type is done by calling Convert.ChangeType Instances may override this behavior.
    • Method Detail

      • changeType

        public Object changeType​(Object value)
                          throws Exception
        Change value to a value of compatible type. The type of a simple value should match exactly or be convertible to the appropriate type. An array value has to be a single dimension (rank), contain at least one value and contain elements that exactly match the expected type. (We could relax this last requirement so that, for example, you could pass an array of Int32 that could be converted to an array of Double but that seems like overkill).
        Parameters:
        value - The value.
        Returns:
        New value.
        Throws:
        Exception - the exception
      • getDim

        public static int getDim​(Object array)
        Gets the dim. If `array' is an array object returns its dimensions; otherwise returns 0
        Parameters:
        array - the array
        Returns:
        the dim
      • getType

        public Class<?> getType()
        Gets the type.
        Returns:
        the type
      • setType

        public void setType​(Class<?> cls)
        Sets the type.
        Parameters:
        cls - the new type
      • getIsArray

        public boolean getIsArray()
        Gets a value indicating whether this instance is array.
        Returns:
        the checks if is array
      • setIsArray

        protected void setIsArray​(boolean value)
        Sets the checks if is array.
        Parameters:
        value - the new checks if is array
      • getConvertToString

        protected IFunction<Object,​StringgetConvertToString()
        Gets the string to object converter. For array types, this method is called for each array element.
        Returns:
        the convert to string
      • getParse

        protected IFunction<String,​ObjectgetParse()
        Gets the string parser. For array types, this method is called for each array element.
        Returns:
        the parses the
      • getDefaultValue

        protected Object getDefaultValue()
        Gets the default value for the type.
        Returns:
        Type