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

import (
	"sync"

	"code.cloudfoundry.org/gorouter/metrics/monitor"
)

type FakeSubscriber struct {
	DroppedStub        func() (int, error)
	droppedMutex       sync.RWMutex
	droppedArgsForCall []struct {
	}
	droppedReturns struct {
		result1 int
		result2 error
	}
	droppedReturnsOnCall map[int]struct {
		result1 int
		result2 error
	}
	PendingStub        func() (int, error)
	pendingMutex       sync.RWMutex
	pendingArgsForCall []struct {
	}
	pendingReturns struct {
		result1 int
		result2 error
	}
	pendingReturnsOnCall map[int]struct {
		result1 int
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeSubscriber) Dropped() (int, error) {
	fake.droppedMutex.Lock()
	ret, specificReturn := fake.droppedReturnsOnCall[len(fake.droppedArgsForCall)]
	fake.droppedArgsForCall = append(fake.droppedArgsForCall, struct {
	}{})
	stub := fake.DroppedStub
	fakeReturns := fake.droppedReturns
	fake.recordInvocation("Dropped", []interface{}{})
	fake.droppedMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeSubscriber) DroppedCallCount() int {
	fake.droppedMutex.RLock()
	defer fake.droppedMutex.RUnlock()
	return len(fake.droppedArgsForCall)
}

func (fake *FakeSubscriber) DroppedCalls(stub func() (int, error)) {
	fake.droppedMutex.Lock()
	defer fake.droppedMutex.Unlock()
	fake.DroppedStub = stub
}

func (fake *FakeSubscriber) DroppedReturns(result1 int, result2 error) {
	fake.droppedMutex.Lock()
	defer fake.droppedMutex.Unlock()
	fake.DroppedStub = nil
	fake.droppedReturns = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeSubscriber) DroppedReturnsOnCall(i int, result1 int, result2 error) {
	fake.droppedMutex.Lock()
	defer fake.droppedMutex.Unlock()
	fake.DroppedStub = nil
	if fake.droppedReturnsOnCall == nil {
		fake.droppedReturnsOnCall = make(map[int]struct {
			result1 int
			result2 error
		})
	}
	fake.droppedReturnsOnCall[i] = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeSubscriber) Pending() (int, error) {
	fake.pendingMutex.Lock()
	ret, specificReturn := fake.pendingReturnsOnCall[len(fake.pendingArgsForCall)]
	fake.pendingArgsForCall = append(fake.pendingArgsForCall, struct {
	}{})
	stub := fake.PendingStub
	fakeReturns := fake.pendingReturns
	fake.recordInvocation("Pending", []interface{}{})
	fake.pendingMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeSubscriber) PendingCallCount() int {
	fake.pendingMutex.RLock()
	defer fake.pendingMutex.RUnlock()
	return len(fake.pendingArgsForCall)
}

func (fake *FakeSubscriber) PendingCalls(stub func() (int, error)) {
	fake.pendingMutex.Lock()
	defer fake.pendingMutex.Unlock()
	fake.PendingStub = stub
}

func (fake *FakeSubscriber) PendingReturns(result1 int, result2 error) {
	fake.pendingMutex.Lock()
	defer fake.pendingMutex.Unlock()
	fake.PendingStub = nil
	fake.pendingReturns = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeSubscriber) PendingReturnsOnCall(i int, result1 int, result2 error) {
	fake.pendingMutex.Lock()
	defer fake.pendingMutex.Unlock()
	fake.PendingStub = nil
	if fake.pendingReturnsOnCall == nil {
		fake.pendingReturnsOnCall = make(map[int]struct {
			result1 int
			result2 error
		})
	}
	fake.pendingReturnsOnCall[i] = struct {
		result1 int
		result2 error
	}{result1, result2}
}

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

func (fake *FakeSubscriber) 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 _ monitor.Subscriber = new(FakeSubscriber)
