class YamlUtil {
    private static DumperOptions dumperOptions = new DumperOptions();
    static {
        dumperOptions.setDefaultFlowStyle(FlowStyle.BLOCK);
    }

    public static boolean isYamlFormat(String yaml) {<FILL_FUNCTION_BODY>}

    public static <T> String toYaml(T object) {
        // 非线程安全
        Yaml snakeYaml = new Yaml(dumperOptions);

        return snakeYaml.dump(object);
    }

    public static <T> T fromYaml(String yaml, Class<T> clazz) {
        // 非线程安全
        Yaml snakeYaml = new Yaml();

        return snakeYaml.loadAs(yaml, clazz);
    }

    public static boolean isYamlFormat(SafeConstructor safeConstructor, String yaml) {
        if (StringUtils.isBlank(yaml)) {
            return false;
        }

        // 非线程安全
        Yaml snakeYaml = new Yaml(safeConstructor);
        try {
            snakeYaml.load(yaml);

            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public static <T> String toYaml(SafeConstructor safeConstructor, T object) {
        // 非线程安全
        Yaml snakeYaml = new Yaml(safeConstructor, new Representer(), dumperOptions);

        return snakeYaml.dump(object);
    }

    public static <T> T fromYaml(SafeConstructor safeConstructor, String yaml, Class<T> clazz) {
        // 非线程安全
        Yaml snakeYaml = new Yaml(safeConstructor);

        return snakeYaml.loadAs(yaml, clazz);
    }
}

        if (StringUtils.isBlank(yaml)) {
            return false;
        }

        // 非线程安全
        Yaml snakeYaml = new Yaml();
        try {
            snakeYaml.load(yaml);

            return true;
        } catch (Exception e) {
            return false;
        }
    
<no_super_class>