implement method to convert object type