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

import (
	"context"
	"sync"

	"sigs.k8s.io/controller-runtime/pkg/client"
)

type FakeFieldIndexer struct {
	IndexFieldStub        func(context.Context, client.Object, string, client.IndexerFunc) error
	indexFieldMutex       sync.RWMutex
	indexFieldArgsForCall []struct {
		arg1 context.Context
		arg2 client.Object
		arg3 string
		arg4 client.IndexerFunc
	}
	indexFieldReturns struct {
		result1 error
	}
	indexFieldReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeFieldIndexer) IndexField(arg1 context.Context, arg2 client.Object, arg3 string, arg4 client.IndexerFunc) error {
	fake.indexFieldMutex.Lock()
	ret, specificReturn := fake.indexFieldReturnsOnCall[len(fake.indexFieldArgsForCall)]
	fake.indexFieldArgsForCall = append(fake.indexFieldArgsForCall, struct {
		arg1 context.Context
		arg2 client.Object
		arg3 string
		arg4 client.IndexerFunc
	}{arg1, arg2, arg3, arg4})
	stub := fake.IndexFieldStub
	fakeReturns := fake.indexFieldReturns
	fake.recordInvocation("IndexField", []interface{}{arg1, arg2, arg3, arg4})
	fake.indexFieldMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeFieldIndexer) IndexFieldCallCount() int {
	fake.indexFieldMutex.RLock()
	defer fake.indexFieldMutex.RUnlock()
	return len(fake.indexFieldArgsForCall)
}

func (fake *FakeFieldIndexer) IndexFieldCalls(stub func(context.Context, client.Object, string, client.IndexerFunc) error) {
	fake.indexFieldMutex.Lock()
	defer fake.indexFieldMutex.Unlock()
	fake.IndexFieldStub = stub
}

func (fake *FakeFieldIndexer) IndexFieldArgsForCall(i int) (context.Context, client.Object, string, client.IndexerFunc) {
	fake.indexFieldMutex.RLock()
	defer fake.indexFieldMutex.RUnlock()
	argsForCall := fake.indexFieldArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *FakeFieldIndexer) IndexFieldReturns(result1 error) {
	fake.indexFieldMutex.Lock()
	defer fake.indexFieldMutex.Unlock()
	fake.IndexFieldStub = nil
	fake.indexFieldReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeFieldIndexer) IndexFieldReturnsOnCall(i int, result1 error) {
	fake.indexFieldMutex.Lock()
	defer fake.indexFieldMutex.Unlock()
	fake.IndexFieldStub = nil
	if fake.indexFieldReturnsOnCall == nil {
		fake.indexFieldReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.indexFieldReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeFieldIndexer) 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 _ client.FieldIndexer = new(FakeFieldIndexer)
