
website.automate.waml.io.mappers.ActionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of waml-io Show documentation
Show all versions of waml-io Show documentation
(De)Serializer of the web automation markup language (WAML) for Java
The newest version!
package website.automate.waml.io.mappers;
import com.fasterxml.jackson.databind.ObjectMapper;
import website.automate.waml.io.model.main.action.Action;
public class ActionMapper {
private ObjectMapper objectMapper;
public ActionMapper(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}
@SuppressWarnings("unchecked")
public T map(T action) {
try {
return (T) objectMapper.readValue(objectMapper.writeValueAsString(action),
action.getClass());
} catch (Exception e) {
throw new RuntimeException("Can't map action!", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy