class StringToEnumConverter extends AbstractConverter {

    @Override
    public boolean canHandle(Object source, TypeToken<?> targetTypeToken) {
        Class enumClass = targetTypeToken.getRawType();
        return (source instanceof String) && enumClass.isEnum();
    }

}