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

import (
	"sync"

	"github.com/conflowio/parsley/parsley"
)

type FakeTransformable struct {
	TransformStub        func(userCtx interface{}) (parsley.Node, parsley.Error)
	transformMutex       sync.RWMutex
	transformArgsForCall []struct {
		userCtx interface{}
	}
	transformReturns struct {
		result1 parsley.Node
		result2 parsley.Error
	}
	transformReturnsOnCall map[int]struct {
		result1 parsley.Node
		result2 parsley.Error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeTransformable) Transform(userCtx interface{}) (parsley.Node, parsley.Error) {
	fake.transformMutex.Lock()
	ret, specificReturn := fake.transformReturnsOnCall[len(fake.transformArgsForCall)]
	fake.transformArgsForCall = append(fake.transformArgsForCall, struct {
		userCtx interface{}
	}{userCtx})
	fake.recordInvocation("Transform", []interface{}{userCtx})
	fake.transformMutex.Unlock()
	if fake.TransformStub != nil {
		return fake.TransformStub(userCtx)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.transformReturns.result1, fake.transformReturns.result2
}

func (fake *FakeTransformable) TransformCallCount() int {
	fake.transformMutex.RLock()
	defer fake.transformMutex.RUnlock()
	return len(fake.transformArgsForCall)
}

func (fake *FakeTransformable) TransformArgsForCall(i int) interface{} {
	fake.transformMutex.RLock()
	defer fake.transformMutex.RUnlock()
	return fake.transformArgsForCall[i].userCtx
}

func (fake *FakeTransformable) TransformReturns(result1 parsley.Node, result2 parsley.Error) {
	fake.TransformStub = nil
	fake.transformReturns = struct {
		result1 parsley.Node
		result2 parsley.Error
	}{result1, result2}
}

func (fake *FakeTransformable) TransformReturnsOnCall(i int, result1 parsley.Node, result2 parsley.Error) {
	fake.TransformStub = nil
	if fake.transformReturnsOnCall == nil {
		fake.transformReturnsOnCall = make(map[int]struct {
			result1 parsley.Node
			result2 parsley.Error
		})
	}
	fake.transformReturnsOnCall[i] = struct {
		result1 parsley.Node
		result2 parsley.Error
	}{result1, result2}
}

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

func (fake *FakeTransformable) 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 _ parsley.Transformable = new(FakeTransformable)
