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

import (
	"sync"

	"github.com/hyperledger/fabric/orderer/common/follower"
)

type ChainCreator struct {
	SwitchFollowerToChainStub        func(string) bool
	switchFollowerToChainMutex       sync.RWMutex
	switchFollowerToChainArgsForCall []struct {
		arg1 string
	}
	switchFollowerToChainReturns struct {
		result1 bool
	}
	switchFollowerToChainReturnsOnCall map[int]struct {
		result1 bool
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ChainCreator) SwitchFollowerToChain(arg1 string) bool {
	fake.switchFollowerToChainMutex.Lock()
	ret, specificReturn := fake.switchFollowerToChainReturnsOnCall[len(fake.switchFollowerToChainArgsForCall)]
	fake.switchFollowerToChainArgsForCall = append(fake.switchFollowerToChainArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("SwitchFollowerToChain", []interface{}{arg1})
	fake.switchFollowerToChainMutex.Unlock()
	if fake.SwitchFollowerToChainStub != nil {
		return fake.SwitchFollowerToChainStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.switchFollowerToChainReturns
	return fakeReturns.result1
}

func (fake *ChainCreator) SwitchFollowerToChainCallCount() int {
	fake.switchFollowerToChainMutex.RLock()
	defer fake.switchFollowerToChainMutex.RUnlock()
	return len(fake.switchFollowerToChainArgsForCall)
}

func (fake *ChainCreator) SwitchFollowerToChainCalls(stub func(string) bool) {
	fake.switchFollowerToChainMutex.Lock()
	defer fake.switchFollowerToChainMutex.Unlock()
	fake.SwitchFollowerToChainStub = stub
}

func (fake *ChainCreator) SwitchFollowerToChainArgsForCall(i int) string {
	fake.switchFollowerToChainMutex.RLock()
	defer fake.switchFollowerToChainMutex.RUnlock()
	argsForCall := fake.switchFollowerToChainArgsForCall[i]
	return argsForCall.arg1
}

func (fake *ChainCreator) SwitchFollowerToChainReturns(result1 bool) {
	fake.switchFollowerToChainMutex.Lock()
	defer fake.switchFollowerToChainMutex.Unlock()
	fake.SwitchFollowerToChainStub = nil
	fake.switchFollowerToChainReturns = struct {
		result1 bool
	}{result1}
}

func (fake *ChainCreator) SwitchFollowerToChainReturnsOnCall(i int, result1 bool) {
	fake.switchFollowerToChainMutex.Lock()
	defer fake.switchFollowerToChainMutex.Unlock()
	fake.SwitchFollowerToChainStub = nil
	if fake.switchFollowerToChainReturnsOnCall == nil {
		fake.switchFollowerToChainReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.switchFollowerToChainReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

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

func (fake *ChainCreator) 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 _ follower.ChainCreator = new(ChainCreator)
