A function to convert plain javascript object(usually deserialized from JSON) into some class instance