// Code generated by counterfeiter. DO NOT EDIT.
//
//lint:file-ignore ST1008 Generated mocks reflect original interface signatures
package mocks

import (
	"sync"

	"github.com/grafana/nanogit/protocol"
	"github.com/grafana/nanogit/protocol/hash"
	"github.com/grafana/nanogit/storage"
)

type FakePackfileStorage struct {
	AddStub        func(...*protocol.PackfileObject)
	addMutex       sync.RWMutex
	addArgsForCall []struct {
		arg1 []*protocol.PackfileObject
	}
	DeleteStub        func(hash.Hash)
	deleteMutex       sync.RWMutex
	deleteArgsForCall []struct {
		arg1 hash.Hash
	}
	GetStub        func(hash.Hash) (*protocol.PackfileObject, bool)
	getMutex       sync.RWMutex
	getArgsForCall []struct {
		arg1 hash.Hash
	}
	getReturns struct {
		result1 *protocol.PackfileObject
		result2 bool
	}
	getReturnsOnCall map[int]struct {
		result1 *protocol.PackfileObject
		result2 bool
	}
	GetAllKeysStub        func() []hash.Hash
	getAllKeysMutex       sync.RWMutex
	getAllKeysArgsForCall []struct {
	}
	getAllKeysReturns struct {
		result1 []hash.Hash
	}
	getAllKeysReturnsOnCall map[int]struct {
		result1 []hash.Hash
	}
	GetByTypeStub        func(hash.Hash, protocol.ObjectType) (*protocol.PackfileObject, bool)
	getByTypeMutex       sync.RWMutex
	getByTypeArgsForCall []struct {
		arg1 hash.Hash
		arg2 protocol.ObjectType
	}
	getByTypeReturns struct {
		result1 *protocol.PackfileObject
		result2 bool
	}
	getByTypeReturnsOnCall map[int]struct {
		result1 *protocol.PackfileObject
		result2 bool
	}
	LenStub        func() int
	lenMutex       sync.RWMutex
	lenArgsForCall []struct {
	}
	lenReturns struct {
		result1 int
	}
	lenReturnsOnCall map[int]struct {
		result1 int
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakePackfileStorage) Add(arg1 ...*protocol.PackfileObject) {
	fake.addMutex.Lock()
	fake.addArgsForCall = append(fake.addArgsForCall, struct {
		arg1 []*protocol.PackfileObject
	}{arg1})
	stub := fake.AddStub
	fake.recordInvocation("Add", []interface{}{arg1})
	fake.addMutex.Unlock()
	if stub != nil {
		fake.AddStub(arg1...)
	}
}

func (fake *FakePackfileStorage) AddCallCount() int {
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	return len(fake.addArgsForCall)
}

func (fake *FakePackfileStorage) AddCalls(stub func(...*protocol.PackfileObject)) {
	fake.addMutex.Lock()
	defer fake.addMutex.Unlock()
	fake.AddStub = stub
}

func (fake *FakePackfileStorage) AddArgsForCall(i int) []*protocol.PackfileObject {
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	argsForCall := fake.addArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePackfileStorage) Delete(arg1 hash.Hash) {
	fake.deleteMutex.Lock()
	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
		arg1 hash.Hash
	}{arg1})
	stub := fake.DeleteStub
	fake.recordInvocation("Delete", []interface{}{arg1})
	fake.deleteMutex.Unlock()
	if stub != nil {
		fake.DeleteStub(arg1)
	}
}

func (fake *FakePackfileStorage) DeleteCallCount() int {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	return len(fake.deleteArgsForCall)
}

func (fake *FakePackfileStorage) DeleteCalls(stub func(hash.Hash)) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = stub
}

func (fake *FakePackfileStorage) DeleteArgsForCall(i int) hash.Hash {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	argsForCall := fake.deleteArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePackfileStorage) Get(arg1 hash.Hash) (*protocol.PackfileObject, bool) {
	fake.getMutex.Lock()
	ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)]
	fake.getArgsForCall = append(fake.getArgsForCall, struct {
		arg1 hash.Hash
	}{arg1})
	stub := fake.GetStub
	fakeReturns := fake.getReturns
	fake.recordInvocation("Get", []interface{}{arg1})
	fake.getMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakePackfileStorage) GetCallCount() int {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	return len(fake.getArgsForCall)
}

func (fake *FakePackfileStorage) GetCalls(stub func(hash.Hash) (*protocol.PackfileObject, bool)) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = stub
}

func (fake *FakePackfileStorage) GetArgsForCall(i int) hash.Hash {
	fake.getMutex.RLock()
	defer fake.getMutex.RUnlock()
	argsForCall := fake.getArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePackfileStorage) GetReturns(result1 *protocol.PackfileObject, result2 bool) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	fake.getReturns = struct {
		result1 *protocol.PackfileObject
		result2 bool
	}{result1, result2}
}

func (fake *FakePackfileStorage) GetReturnsOnCall(i int, result1 *protocol.PackfileObject, result2 bool) {
	fake.getMutex.Lock()
	defer fake.getMutex.Unlock()
	fake.GetStub = nil
	if fake.getReturnsOnCall == nil {
		fake.getReturnsOnCall = make(map[int]struct {
			result1 *protocol.PackfileObject
			result2 bool
		})
	}
	fake.getReturnsOnCall[i] = struct {
		result1 *protocol.PackfileObject
		result2 bool
	}{result1, result2}
}

func (fake *FakePackfileStorage) GetAllKeys() []hash.Hash {
	fake.getAllKeysMutex.Lock()
	ret, specificReturn := fake.getAllKeysReturnsOnCall[len(fake.getAllKeysArgsForCall)]
	fake.getAllKeysArgsForCall = append(fake.getAllKeysArgsForCall, struct {
	}{})
	stub := fake.GetAllKeysStub
	fakeReturns := fake.getAllKeysReturns
	fake.recordInvocation("GetAllKeys", []interface{}{})
	fake.getAllKeysMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakePackfileStorage) GetAllKeysCallCount() int {
	fake.getAllKeysMutex.RLock()
	defer fake.getAllKeysMutex.RUnlock()
	return len(fake.getAllKeysArgsForCall)
}

func (fake *FakePackfileStorage) GetAllKeysCalls(stub func() []hash.Hash) {
	fake.getAllKeysMutex.Lock()
	defer fake.getAllKeysMutex.Unlock()
	fake.GetAllKeysStub = stub
}

func (fake *FakePackfileStorage) GetAllKeysReturns(result1 []hash.Hash) {
	fake.getAllKeysMutex.Lock()
	defer fake.getAllKeysMutex.Unlock()
	fake.GetAllKeysStub = nil
	fake.getAllKeysReturns = struct {
		result1 []hash.Hash
	}{result1}
}

func (fake *FakePackfileStorage) GetAllKeysReturnsOnCall(i int, result1 []hash.Hash) {
	fake.getAllKeysMutex.Lock()
	defer fake.getAllKeysMutex.Unlock()
	fake.GetAllKeysStub = nil
	if fake.getAllKeysReturnsOnCall == nil {
		fake.getAllKeysReturnsOnCall = make(map[int]struct {
			result1 []hash.Hash
		})
	}
	fake.getAllKeysReturnsOnCall[i] = struct {
		result1 []hash.Hash
	}{result1}
}

func (fake *FakePackfileStorage) GetByType(arg1 hash.Hash, arg2 protocol.ObjectType) (*protocol.PackfileObject, bool) {
	fake.getByTypeMutex.Lock()
	ret, specificReturn := fake.getByTypeReturnsOnCall[len(fake.getByTypeArgsForCall)]
	fake.getByTypeArgsForCall = append(fake.getByTypeArgsForCall, struct {
		arg1 hash.Hash
		arg2 protocol.ObjectType
	}{arg1, arg2})
	stub := fake.GetByTypeStub
	fakeReturns := fake.getByTypeReturns
	fake.recordInvocation("GetByType", []interface{}{arg1, arg2})
	fake.getByTypeMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakePackfileStorage) GetByTypeCallCount() int {
	fake.getByTypeMutex.RLock()
	defer fake.getByTypeMutex.RUnlock()
	return len(fake.getByTypeArgsForCall)
}

func (fake *FakePackfileStorage) GetByTypeCalls(stub func(hash.Hash, protocol.ObjectType) (*protocol.PackfileObject, bool)) {
	fake.getByTypeMutex.Lock()
	defer fake.getByTypeMutex.Unlock()
	fake.GetByTypeStub = stub
}

func (fake *FakePackfileStorage) GetByTypeArgsForCall(i int) (hash.Hash, protocol.ObjectType) {
	fake.getByTypeMutex.RLock()
	defer fake.getByTypeMutex.RUnlock()
	argsForCall := fake.getByTypeArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakePackfileStorage) GetByTypeReturns(result1 *protocol.PackfileObject, result2 bool) {
	fake.getByTypeMutex.Lock()
	defer fake.getByTypeMutex.Unlock()
	fake.GetByTypeStub = nil
	fake.getByTypeReturns = struct {
		result1 *protocol.PackfileObject
		result2 bool
	}{result1, result2}
}

func (fake *FakePackfileStorage) GetByTypeReturnsOnCall(i int, result1 *protocol.PackfileObject, result2 bool) {
	fake.getByTypeMutex.Lock()
	defer fake.getByTypeMutex.Unlock()
	fake.GetByTypeStub = nil
	if fake.getByTypeReturnsOnCall == nil {
		fake.getByTypeReturnsOnCall = make(map[int]struct {
			result1 *protocol.PackfileObject
			result2 bool
		})
	}
	fake.getByTypeReturnsOnCall[i] = struct {
		result1 *protocol.PackfileObject
		result2 bool
	}{result1, result2}
}

func (fake *FakePackfileStorage) Len() int {
	fake.lenMutex.Lock()
	ret, specificReturn := fake.lenReturnsOnCall[len(fake.lenArgsForCall)]
	fake.lenArgsForCall = append(fake.lenArgsForCall, struct {
	}{})
	stub := fake.LenStub
	fakeReturns := fake.lenReturns
	fake.recordInvocation("Len", []interface{}{})
	fake.lenMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakePackfileStorage) LenCallCount() int {
	fake.lenMutex.RLock()
	defer fake.lenMutex.RUnlock()
	return len(fake.lenArgsForCall)
}

func (fake *FakePackfileStorage) LenCalls(stub func() int) {
	fake.lenMutex.Lock()
	defer fake.lenMutex.Unlock()
	fake.LenStub = stub
}

func (fake *FakePackfileStorage) LenReturns(result1 int) {
	fake.lenMutex.Lock()
	defer fake.lenMutex.Unlock()
	fake.LenStub = nil
	fake.lenReturns = struct {
		result1 int
	}{result1}
}

func (fake *FakePackfileStorage) LenReturnsOnCall(i int, result1 int) {
	fake.lenMutex.Lock()
	defer fake.lenMutex.Unlock()
	fake.LenStub = nil
	if fake.lenReturnsOnCall == nil {
		fake.lenReturnsOnCall = make(map[int]struct {
			result1 int
		})
	}
	fake.lenReturnsOnCall[i] = struct {
		result1 int
	}{result1}
}

func (fake *FakePackfileStorage) 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 *FakePackfileStorage) 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 _ storage.PackfileStorage = new(FakePackfileStorage)
