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

import (
	"net"
	"sync"

	"code.cloudfoundry.org/guardian/kawasaki"
	lager "code.cloudfoundry.org/lager/v3"
)

type FakeHostFileCompiler struct {
	CompileStub        func(lager.Logger, net.IP, net.IP, string, []string) ([]byte, error)
	compileMutex       sync.RWMutex
	compileArgsForCall []struct {
		arg1 lager.Logger
		arg2 net.IP
		arg3 net.IP
		arg4 string
		arg5 []string
	}
	compileReturns struct {
		result1 []byte
		result2 error
	}
	compileReturnsOnCall map[int]struct {
		result1 []byte
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeHostFileCompiler) Compile(arg1 lager.Logger, arg2 net.IP, arg3 net.IP, arg4 string, arg5 []string) ([]byte, error) {
	var arg5Copy []string
	if arg5 != nil {
		arg5Copy = make([]string, len(arg5))
		copy(arg5Copy, arg5)
	}
	fake.compileMutex.Lock()
	ret, specificReturn := fake.compileReturnsOnCall[len(fake.compileArgsForCall)]
	fake.compileArgsForCall = append(fake.compileArgsForCall, struct {
		arg1 lager.Logger
		arg2 net.IP
		arg3 net.IP
		arg4 string
		arg5 []string
	}{arg1, arg2, arg3, arg4, arg5Copy})
	stub := fake.CompileStub
	fakeReturns := fake.compileReturns
	fake.recordInvocation("Compile", []interface{}{arg1, arg2, arg3, arg4, arg5Copy})
	fake.compileMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeHostFileCompiler) CompileCallCount() int {
	fake.compileMutex.RLock()
	defer fake.compileMutex.RUnlock()
	return len(fake.compileArgsForCall)
}

func (fake *FakeHostFileCompiler) CompileCalls(stub func(lager.Logger, net.IP, net.IP, string, []string) ([]byte, error)) {
	fake.compileMutex.Lock()
	defer fake.compileMutex.Unlock()
	fake.CompileStub = stub
}

func (fake *FakeHostFileCompiler) CompileArgsForCall(i int) (lager.Logger, net.IP, net.IP, string, []string) {
	fake.compileMutex.RLock()
	defer fake.compileMutex.RUnlock()
	argsForCall := fake.compileArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *FakeHostFileCompiler) CompileReturns(result1 []byte, result2 error) {
	fake.compileMutex.Lock()
	defer fake.compileMutex.Unlock()
	fake.CompileStub = nil
	fake.compileReturns = struct {
		result1 []byte
		result2 error
	}{result1, result2}
}

func (fake *FakeHostFileCompiler) CompileReturnsOnCall(i int, result1 []byte, result2 error) {
	fake.compileMutex.Lock()
	defer fake.compileMutex.Unlock()
	fake.CompileStub = nil
	if fake.compileReturnsOnCall == nil {
		fake.compileReturnsOnCall = make(map[int]struct {
			result1 []byte
			result2 error
		})
	}
	fake.compileReturnsOnCall[i] = struct {
		result1 []byte
		result2 error
	}{result1, result2}
}

func (fake *FakeHostFileCompiler) 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 *FakeHostFileCompiler) 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 _ kawasaki.HostFileCompiler = new(FakeHostFileCompiler)
