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

import (
	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/ratelimiter"
	"sync"
)

type FakeLimiter struct {
	ExceedsLimitStub        func(string) bool
	exceedsLimitMutex       sync.RWMutex
	exceedsLimitArgsForCall []struct {
		arg1 string
	}
	exceedsLimitReturns struct {
		result1 bool
	}
	exceedsLimitReturnsOnCall map[int]struct {
		result1 bool
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeLimiter) ExceedsLimit(arg1 string) bool {
	fake.exceedsLimitMutex.Lock()
	ret, specificReturn := fake.exceedsLimitReturnsOnCall[len(fake.exceedsLimitArgsForCall)]
	fake.exceedsLimitArgsForCall = append(fake.exceedsLimitArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("ExceedsLimit", []interface{}{arg1})
	fake.exceedsLimitMutex.Unlock()
	if fake.ExceedsLimitStub != nil {
		return fake.ExceedsLimitStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.exceedsLimitReturns.result1
}

func (fake *FakeLimiter) ExceedsLimitCallCount() int {
	fake.exceedsLimitMutex.RLock()
	defer fake.exceedsLimitMutex.RUnlock()
	return len(fake.exceedsLimitArgsForCall)
}

func (fake *FakeLimiter) ExceedsLimitArgsForCall(i int) string {
	fake.exceedsLimitMutex.RLock()
	defer fake.exceedsLimitMutex.RUnlock()
	return fake.exceedsLimitArgsForCall[i].arg1
}

func (fake *FakeLimiter) ExceedsLimitReturns(result1 bool) {
	fake.ExceedsLimitStub = nil
	fake.exceedsLimitReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeLimiter) ExceedsLimitReturnsOnCall(i int, result1 bool) {
	fake.ExceedsLimitStub = nil
	if fake.exceedsLimitReturnsOnCall == nil {
		fake.exceedsLimitReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.exceedsLimitReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

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

func (fake *FakeLimiter) 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 _ ratelimiter.Limiter = new(FakeLimiter)
