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

import (
	"sync"

	"code.cloudfoundry.org/guardian/kawasaki/iptables"
)

type FakeRule struct {
	FlagsStub        func(string) []string
	flagsMutex       sync.RWMutex
	flagsArgsForCall []struct {
		arg1 string
	}
	flagsReturns struct {
		result1 []string
	}
	flagsReturnsOnCall map[int]struct {
		result1 []string
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRule) Flags(arg1 string) []string {
	fake.flagsMutex.Lock()
	ret, specificReturn := fake.flagsReturnsOnCall[len(fake.flagsArgsForCall)]
	fake.flagsArgsForCall = append(fake.flagsArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.FlagsStub
	fakeReturns := fake.flagsReturns
	fake.recordInvocation("Flags", []interface{}{arg1})
	fake.flagsMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRule) FlagsCallCount() int {
	fake.flagsMutex.RLock()
	defer fake.flagsMutex.RUnlock()
	return len(fake.flagsArgsForCall)
}

func (fake *FakeRule) FlagsCalls(stub func(string) []string) {
	fake.flagsMutex.Lock()
	defer fake.flagsMutex.Unlock()
	fake.FlagsStub = stub
}

func (fake *FakeRule) FlagsArgsForCall(i int) string {
	fake.flagsMutex.RLock()
	defer fake.flagsMutex.RUnlock()
	argsForCall := fake.flagsArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRule) FlagsReturns(result1 []string) {
	fake.flagsMutex.Lock()
	defer fake.flagsMutex.Unlock()
	fake.FlagsStub = nil
	fake.flagsReturns = struct {
		result1 []string
	}{result1}
}

func (fake *FakeRule) FlagsReturnsOnCall(i int, result1 []string) {
	fake.flagsMutex.Lock()
	defer fake.flagsMutex.Unlock()
	fake.FlagsStub = nil
	if fake.flagsReturnsOnCall == nil {
		fake.flagsReturnsOnCall = make(map[int]struct {
			result1 []string
		})
	}
	fake.flagsReturnsOnCall[i] = struct {
		result1 []string
	}{result1}
}

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

func (fake *FakeRule) 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 _ iptables.Rule = new(FakeRule)
