// Code generated by counterfeiter. DO NOT EDIT.
package fakes

import (
	"sync"

	"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
	"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler"
)

type FakeRegistryReconcilerFactory struct {
	ReconcilerForSourceStub        func(*v1alpha1.CatalogSource) reconciler.RegistryReconciler
	reconcilerForSourceMutex       sync.RWMutex
	reconcilerForSourceArgsForCall []struct {
		arg1 *v1alpha1.CatalogSource
	}
	reconcilerForSourceReturns struct {
		result1 reconciler.RegistryReconciler
	}
	reconcilerForSourceReturnsOnCall map[int]struct {
		result1 reconciler.RegistryReconciler
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRegistryReconcilerFactory) ReconcilerForSource(arg1 *v1alpha1.CatalogSource) reconciler.RegistryReconciler {
	fake.reconcilerForSourceMutex.Lock()
	ret, specificReturn := fake.reconcilerForSourceReturnsOnCall[len(fake.reconcilerForSourceArgsForCall)]
	fake.reconcilerForSourceArgsForCall = append(fake.reconcilerForSourceArgsForCall, struct {
		arg1 *v1alpha1.CatalogSource
	}{arg1})
	fake.recordInvocation("ReconcilerForSource", []interface{}{arg1})
	fake.reconcilerForSourceMutex.Unlock()
	if fake.ReconcilerForSourceStub != nil {
		return fake.ReconcilerForSourceStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.reconcilerForSourceReturns
	return fakeReturns.result1
}

func (fake *FakeRegistryReconcilerFactory) ReconcilerForSourceCallCount() int {
	fake.reconcilerForSourceMutex.RLock()
	defer fake.reconcilerForSourceMutex.RUnlock()
	return len(fake.reconcilerForSourceArgsForCall)
}

func (fake *FakeRegistryReconcilerFactory) ReconcilerForSourceCalls(stub func(*v1alpha1.CatalogSource) reconciler.RegistryReconciler) {
	fake.reconcilerForSourceMutex.Lock()
	defer fake.reconcilerForSourceMutex.Unlock()
	fake.ReconcilerForSourceStub = stub
}

func (fake *FakeRegistryReconcilerFactory) ReconcilerForSourceArgsForCall(i int) *v1alpha1.CatalogSource {
	fake.reconcilerForSourceMutex.RLock()
	defer fake.reconcilerForSourceMutex.RUnlock()
	argsForCall := fake.reconcilerForSourceArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRegistryReconcilerFactory) ReconcilerForSourceReturns(result1 reconciler.RegistryReconciler) {
	fake.reconcilerForSourceMutex.Lock()
	defer fake.reconcilerForSourceMutex.Unlock()
	fake.ReconcilerForSourceStub = nil
	fake.reconcilerForSourceReturns = struct {
		result1 reconciler.RegistryReconciler
	}{result1}
}

func (fake *FakeRegistryReconcilerFactory) ReconcilerForSourceReturnsOnCall(i int, result1 reconciler.RegistryReconciler) {
	fake.reconcilerForSourceMutex.Lock()
	defer fake.reconcilerForSourceMutex.Unlock()
	fake.ReconcilerForSourceStub = nil
	if fake.reconcilerForSourceReturnsOnCall == nil {
		fake.reconcilerForSourceReturnsOnCall = make(map[int]struct {
			result1 reconciler.RegistryReconciler
		})
	}
	fake.reconcilerForSourceReturnsOnCall[i] = struct {
		result1 reconciler.RegistryReconciler
	}{result1}
}

func (fake *FakeRegistryReconcilerFactory) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.reconcilerForSourceMutex.RLock()
	defer fake.reconcilerForSourceMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeRegistryReconcilerFactory) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ reconciler.RegistryReconcilerFactory = new(FakeRegistryReconcilerFactory)
