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

import (
	"sync"

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

type FakeProcessesStopper struct {
	StopAllStub        func(lager.Logger, string, []int, bool) error
	stopAllMutex       sync.RWMutex
	stopAllArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 []int
		arg4 bool
	}
	stopAllReturns struct {
		result1 error
	}
	stopAllReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeProcessesStopper) StopAll(arg1 lager.Logger, arg2 string, arg3 []int, arg4 bool) error {
	var arg3Copy []int
	if arg3 != nil {
		arg3Copy = make([]int, len(arg3))
		copy(arg3Copy, arg3)
	}
	fake.stopAllMutex.Lock()
	ret, specificReturn := fake.stopAllReturnsOnCall[len(fake.stopAllArgsForCall)]
	fake.stopAllArgsForCall = append(fake.stopAllArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 []int
		arg4 bool
	}{arg1, arg2, arg3Copy, arg4})
	stub := fake.StopAllStub
	fakeReturns := fake.stopAllReturns
	fake.recordInvocation("StopAll", []interface{}{arg1, arg2, arg3Copy, arg4})
	fake.stopAllMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeProcessesStopper) StopAllCallCount() int {
	fake.stopAllMutex.RLock()
	defer fake.stopAllMutex.RUnlock()
	return len(fake.stopAllArgsForCall)
}

func (fake *FakeProcessesStopper) StopAllCalls(stub func(lager.Logger, string, []int, bool) error) {
	fake.stopAllMutex.Lock()
	defer fake.stopAllMutex.Unlock()
	fake.StopAllStub = stub
}

func (fake *FakeProcessesStopper) StopAllArgsForCall(i int) (lager.Logger, string, []int, bool) {
	fake.stopAllMutex.RLock()
	defer fake.stopAllMutex.RUnlock()
	argsForCall := fake.stopAllArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *FakeProcessesStopper) StopAllReturns(result1 error) {
	fake.stopAllMutex.Lock()
	defer fake.stopAllMutex.Unlock()
	fake.StopAllStub = nil
	fake.stopAllReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeProcessesStopper) StopAllReturnsOnCall(i int, result1 error) {
	fake.stopAllMutex.Lock()
	defer fake.stopAllMutex.Unlock()
	fake.StopAllStub = nil
	if fake.stopAllReturnsOnCall == nil {
		fake.stopAllReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.stopAllReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeProcessesStopper) 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 _ rundmc.ProcessesStopper = new(FakeProcessesStopper)
