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

import (
	"sync"

	"github.com/cloudfoundry/dropsonde"
	"github.com/cloudfoundry/sonde-go/events"
)

type FakeEventEmitter struct {
	EmitStub        func(events.Event) error
	emitMutex       sync.RWMutex
	emitArgsForCall []struct {
		arg1 events.Event
	}
	emitReturns struct {
		result1 error
	}
	emitReturnsOnCall map[int]struct {
		result1 error
	}
	EmitEnvelopeStub        func(*events.Envelope) error
	emitEnvelopeMutex       sync.RWMutex
	emitEnvelopeArgsForCall []struct {
		arg1 *events.Envelope
	}
	emitEnvelopeReturns struct {
		result1 error
	}
	emitEnvelopeReturnsOnCall map[int]struct {
		result1 error
	}
	OriginStub        func() string
	originMutex       sync.RWMutex
	originArgsForCall []struct {
	}
	originReturns struct {
		result1 string
	}
	originReturnsOnCall map[int]struct {
		result1 string
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeEventEmitter) Emit(arg1 events.Event) error {
	fake.emitMutex.Lock()
	ret, specificReturn := fake.emitReturnsOnCall[len(fake.emitArgsForCall)]
	fake.emitArgsForCall = append(fake.emitArgsForCall, struct {
		arg1 events.Event
	}{arg1})
	stub := fake.EmitStub
	fakeReturns := fake.emitReturns
	fake.recordInvocation("Emit", []interface{}{arg1})
	fake.emitMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEventEmitter) EmitCallCount() int {
	fake.emitMutex.RLock()
	defer fake.emitMutex.RUnlock()
	return len(fake.emitArgsForCall)
}

func (fake *FakeEventEmitter) EmitCalls(stub func(events.Event) error) {
	fake.emitMutex.Lock()
	defer fake.emitMutex.Unlock()
	fake.EmitStub = stub
}

func (fake *FakeEventEmitter) EmitArgsForCall(i int) events.Event {
	fake.emitMutex.RLock()
	defer fake.emitMutex.RUnlock()
	argsForCall := fake.emitArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEventEmitter) EmitReturns(result1 error) {
	fake.emitMutex.Lock()
	defer fake.emitMutex.Unlock()
	fake.EmitStub = nil
	fake.emitReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeEventEmitter) EmitReturnsOnCall(i int, result1 error) {
	fake.emitMutex.Lock()
	defer fake.emitMutex.Unlock()
	fake.EmitStub = nil
	if fake.emitReturnsOnCall == nil {
		fake.emitReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.emitReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeEventEmitter) EmitEnvelope(arg1 *events.Envelope) error {
	fake.emitEnvelopeMutex.Lock()
	ret, specificReturn := fake.emitEnvelopeReturnsOnCall[len(fake.emitEnvelopeArgsForCall)]
	fake.emitEnvelopeArgsForCall = append(fake.emitEnvelopeArgsForCall, struct {
		arg1 *events.Envelope
	}{arg1})
	stub := fake.EmitEnvelopeStub
	fakeReturns := fake.emitEnvelopeReturns
	fake.recordInvocation("EmitEnvelope", []interface{}{arg1})
	fake.emitEnvelopeMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEventEmitter) EmitEnvelopeCallCount() int {
	fake.emitEnvelopeMutex.RLock()
	defer fake.emitEnvelopeMutex.RUnlock()
	return len(fake.emitEnvelopeArgsForCall)
}

func (fake *FakeEventEmitter) EmitEnvelopeCalls(stub func(*events.Envelope) error) {
	fake.emitEnvelopeMutex.Lock()
	defer fake.emitEnvelopeMutex.Unlock()
	fake.EmitEnvelopeStub = stub
}

func (fake *FakeEventEmitter) EmitEnvelopeArgsForCall(i int) *events.Envelope {
	fake.emitEnvelopeMutex.RLock()
	defer fake.emitEnvelopeMutex.RUnlock()
	argsForCall := fake.emitEnvelopeArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEventEmitter) EmitEnvelopeReturns(result1 error) {
	fake.emitEnvelopeMutex.Lock()
	defer fake.emitEnvelopeMutex.Unlock()
	fake.EmitEnvelopeStub = nil
	fake.emitEnvelopeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeEventEmitter) EmitEnvelopeReturnsOnCall(i int, result1 error) {
	fake.emitEnvelopeMutex.Lock()
	defer fake.emitEnvelopeMutex.Unlock()
	fake.EmitEnvelopeStub = nil
	if fake.emitEnvelopeReturnsOnCall == nil {
		fake.emitEnvelopeReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.emitEnvelopeReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeEventEmitter) Origin() string {
	fake.originMutex.Lock()
	ret, specificReturn := fake.originReturnsOnCall[len(fake.originArgsForCall)]
	fake.originArgsForCall = append(fake.originArgsForCall, struct {
	}{})
	stub := fake.OriginStub
	fakeReturns := fake.originReturns
	fake.recordInvocation("Origin", []interface{}{})
	fake.originMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEventEmitter) OriginCallCount() int {
	fake.originMutex.RLock()
	defer fake.originMutex.RUnlock()
	return len(fake.originArgsForCall)
}

func (fake *FakeEventEmitter) OriginCalls(stub func() string) {
	fake.originMutex.Lock()
	defer fake.originMutex.Unlock()
	fake.OriginStub = stub
}

func (fake *FakeEventEmitter) OriginReturns(result1 string) {
	fake.originMutex.Lock()
	defer fake.originMutex.Unlock()
	fake.OriginStub = nil
	fake.originReturns = struct {
		result1 string
	}{result1}
}

func (fake *FakeEventEmitter) OriginReturnsOnCall(i int, result1 string) {
	fake.originMutex.Lock()
	defer fake.originMutex.Unlock()
	fake.OriginStub = nil
	if fake.originReturnsOnCall == nil {
		fake.originReturnsOnCall = make(map[int]struct {
			result1 string
		})
	}
	fake.originReturnsOnCall[i] = struct {
		result1 string
	}{result1}
}

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

func (fake *FakeEventEmitter) 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 _ dropsonde.EventEmitter = new(FakeEventEmitter)
