public class MapiTypeConverterMapEntry extends Object
Constructor and Description |
---|
MapiTypeConverterMapEntry(Class<?> type)
Initializes a new instance of the MapiTypeConverterMapEntry class.
|
Modifier and Type | Method and Description |
---|---|
Object |
changeType(Object value)
Change value to a value of compatible type.
|
Object |
convertToValue(String stringValue)
Converts a string to value consistent with type.
|
Object |
convertToValueOrDefault(String stringValue)
Converts a string to value consistent with type (or uses the default value if the string is null or empty).
|
protected IFunction<Object,String> |
getConvertToString()
Gets the string to object converter.
|
protected Object |
getDefaultValue()
Gets the default value for the type.
|
static int |
getDim(Object array)
Gets the dim.
|
boolean |
getIsArray()
Gets a value indicating whether this instance is array.
|
protected IFunction<String,Object> |
getParse()
Gets the string parser.
|
Class<?> |
getType()
Gets the type.
|
protected void |
setConvertToString(IFunction<Object,String> value)
Sets the string to object converter.
|
protected void |
setIsArray(boolean value)
Sets the checks if is array.
|
protected void |
setParse(IFunction<String,Object> value)
Sets the string parser.
|
void |
setType(Class<?> cls)
Sets the type.
|
public MapiTypeConverterMapEntry(Class<?> type)
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.public Object changeType(Object value) throws Exception
value
- The value.Exception
- the exceptionpublic Object convertToValue(String stringValue) throws ServiceXmlDeserializationException, FormatException
stringValue
- String to convert to a value.ServiceXmlDeserializationException
- the service xml deserialization exceptionFormatException
- the format exceptionpublic Object convertToValueOrDefault(String stringValue) throws ServiceXmlDeserializationException, FormatException
stringValue
- to convert to a value.FormatException
ServiceXmlDeserializationException
public static int getDim(Object array)
array
- the arraypublic boolean getIsArray()
protected void setIsArray(boolean value)
value
- the new checks if is arrayprotected IFunction<Object,String> getConvertToString()
protected void setConvertToString(IFunction<Object,String> value)
value
- the valueprotected IFunction<String,Object> getParse()
protected void setParse(IFunction<String,Object> value)
value
- the valueprotected Object getDefaultValue()
Copyright © 2012–2015 Microsoft. All rights reserved.