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

import (
	"sync"

	"code.cloudfoundry.org/guardian/gardener"
	lager "code.cloudfoundry.org/lager/v3"
)

type FakePeaCleaner struct {
	CleanStub        func(lager.Logger, string) error
	cleanMutex       sync.RWMutex
	cleanArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	cleanReturns struct {
		result1 error
	}
	cleanReturnsOnCall map[int]struct {
		result1 error
	}
	CleanAllStub        func(lager.Logger) error
	cleanAllMutex       sync.RWMutex
	cleanAllArgsForCall []struct {
		arg1 lager.Logger
	}
	cleanAllReturns struct {
		result1 error
	}
	cleanAllReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakePeaCleaner) Clean(arg1 lager.Logger, arg2 string) error {
	fake.cleanMutex.Lock()
	ret, specificReturn := fake.cleanReturnsOnCall[len(fake.cleanArgsForCall)]
	fake.cleanArgsForCall = append(fake.cleanArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	stub := fake.CleanStub
	fakeReturns := fake.cleanReturns
	fake.recordInvocation("Clean", []interface{}{arg1, arg2})
	fake.cleanMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakePeaCleaner) CleanCallCount() int {
	fake.cleanMutex.RLock()
	defer fake.cleanMutex.RUnlock()
	return len(fake.cleanArgsForCall)
}

func (fake *FakePeaCleaner) CleanCalls(stub func(lager.Logger, string) error) {
	fake.cleanMutex.Lock()
	defer fake.cleanMutex.Unlock()
	fake.CleanStub = stub
}

func (fake *FakePeaCleaner) CleanArgsForCall(i int) (lager.Logger, string) {
	fake.cleanMutex.RLock()
	defer fake.cleanMutex.RUnlock()
	argsForCall := fake.cleanArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakePeaCleaner) CleanReturns(result1 error) {
	fake.cleanMutex.Lock()
	defer fake.cleanMutex.Unlock()
	fake.CleanStub = nil
	fake.cleanReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakePeaCleaner) CleanReturnsOnCall(i int, result1 error) {
	fake.cleanMutex.Lock()
	defer fake.cleanMutex.Unlock()
	fake.CleanStub = nil
	if fake.cleanReturnsOnCall == nil {
		fake.cleanReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.cleanReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakePeaCleaner) CleanAll(arg1 lager.Logger) error {
	fake.cleanAllMutex.Lock()
	ret, specificReturn := fake.cleanAllReturnsOnCall[len(fake.cleanAllArgsForCall)]
	fake.cleanAllArgsForCall = append(fake.cleanAllArgsForCall, struct {
		arg1 lager.Logger
	}{arg1})
	stub := fake.CleanAllStub
	fakeReturns := fake.cleanAllReturns
	fake.recordInvocation("CleanAll", []interface{}{arg1})
	fake.cleanAllMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakePeaCleaner) CleanAllCallCount() int {
	fake.cleanAllMutex.RLock()
	defer fake.cleanAllMutex.RUnlock()
	return len(fake.cleanAllArgsForCall)
}

func (fake *FakePeaCleaner) CleanAllCalls(stub func(lager.Logger) error) {
	fake.cleanAllMutex.Lock()
	defer fake.cleanAllMutex.Unlock()
	fake.CleanAllStub = stub
}

func (fake *FakePeaCleaner) CleanAllArgsForCall(i int) lager.Logger {
	fake.cleanAllMutex.RLock()
	defer fake.cleanAllMutex.RUnlock()
	argsForCall := fake.cleanAllArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePeaCleaner) CleanAllReturns(result1 error) {
	fake.cleanAllMutex.Lock()
	defer fake.cleanAllMutex.Unlock()
	fake.CleanAllStub = nil
	fake.cleanAllReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakePeaCleaner) CleanAllReturnsOnCall(i int, result1 error) {
	fake.cleanAllMutex.Lock()
	defer fake.cleanAllMutex.Unlock()
	fake.CleanAllStub = nil
	if fake.cleanAllReturnsOnCall == nil {
		fake.cleanAllReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.cleanAllReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakePeaCleaner) 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 _ gardener.PeaCleaner = new(FakePeaCleaner)
