// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package azure.core.basic.implementation;

import azure.core.basic.models.User;
import azure.core.basic.models.UserOrder;

/**
 * This is the Helper class to enable json merge patch serialization for a model.
 */
public class JsonMergePatchHelper {
    private static UserAccessor userAccessor;

    public interface UserAccessor {
        User prepareModelForJsonMergePatch(User user, boolean jsonMergePatchEnabled);

        boolean isJsonMergePatch(User user);
    }

    public static void setUserAccessor(UserAccessor accessor) {
        userAccessor = accessor;
    }

    public static UserAccessor getUserAccessor() {
        return userAccessor;
    }

    private static UserOrderAccessor userOrderAccessor;

    public interface UserOrderAccessor {
        UserOrder prepareModelForJsonMergePatch(UserOrder userOrder, boolean jsonMergePatchEnabled);

        boolean isJsonMergePatch(UserOrder userOrder);
    }

    public static void setUserOrderAccessor(UserOrderAccessor accessor) {
        userOrderAccessor = accessor;
    }

    public static UserOrderAccessor getUserOrderAccessor() {
        return userOrderAccessor;
    }
}
