org.easetech.easytest.converter
Interface Converter<Type>

Type Parameters:
Type - the type of object to convert to from a map.
All Known Implementing Classes:
AbstractConverter

public interface Converter<Type>

A generic interface responsible for converting a Map object into a user defined object. The Map object is of type Map<String,List<Map<String,Object>>> It can be read as Map of MethodName as KEY and List of Map of MethodAttributes/MethodAttributeValues as Value. Users should normally extend AbstractConverter instead of implementing this interface as the abstract converter has implementation to methods convertTo() and instanceOfType()
For an example of writing a converter, look at : https://github.com/EaseTech/easytest-core/blob/master/src/test/java/org/easetech/easytest/example/ItemConverter.java

Author:
Anuj Kumar

Method Summary
 Type convert(Map<String,Object> convertFrom)
          Convert the Map into a user defined object.
 Class<Type> convertTo()
          The class of the generic type argument to which the data should be converted to.
 Type instanceOfType()
          Method responsible for returning an instance of the provided Generic Type argument.
 

Method Detail

convertTo

Class<Type> convertTo()
The class of the generic type argument to which the data should be converted to.

Returns:
the class of the object to convert to

convert

Type convert(Map<String,Object> convertFrom)
Convert the Map into a user defined object.

Parameters:
convertFrom - the Map to convert from
Returns:
the object to convert to identified by convertTo() class.

instanceOfType

Type instanceOfType()
Method responsible for returning an instance of the provided Generic Type argument. Look at AbstractConverter.instanceOfType() methods Javadoc for details on the default implementation.

Returns:
an instance of the provided Generic Type argument.


Copyright © 2013. All Rights Reserved.