/*

Don't alter this file, it was generated.

*/
// Code generated by lister-gen. DO NOT EDIT.

package v1alpha1

import (
	v1alpha1 "code.cloudfoundry.org/quarks-statefulset/pkg/kube/apis/quarksstatefulset/v1alpha1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// QuarksStatefulSetLister helps list QuarksStatefulSets.
type QuarksStatefulSetLister interface {
	// List lists all QuarksStatefulSets in the indexer.
	List(selector labels.Selector) (ret []*v1alpha1.QuarksStatefulSet, err error)
	// QuarksStatefulSets returns an object that can list and get QuarksStatefulSets.
	QuarksStatefulSets(namespace string) QuarksStatefulSetNamespaceLister
	QuarksStatefulSetListerExpansion
}

// quarksStatefulSetLister implements the QuarksStatefulSetLister interface.
type quarksStatefulSetLister struct {
	indexer cache.Indexer
}

// NewQuarksStatefulSetLister returns a new QuarksStatefulSetLister.
func NewQuarksStatefulSetLister(indexer cache.Indexer) QuarksStatefulSetLister {
	return &quarksStatefulSetLister{indexer: indexer}
}

// List lists all QuarksStatefulSets in the indexer.
func (s *quarksStatefulSetLister) List(selector labels.Selector) (ret []*v1alpha1.QuarksStatefulSet, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.QuarksStatefulSet))
	})
	return ret, err
}

// QuarksStatefulSets returns an object that can list and get QuarksStatefulSets.
func (s *quarksStatefulSetLister) QuarksStatefulSets(namespace string) QuarksStatefulSetNamespaceLister {
	return quarksStatefulSetNamespaceLister{indexer: s.indexer, namespace: namespace}
}

// QuarksStatefulSetNamespaceLister helps list and get QuarksStatefulSets.
type QuarksStatefulSetNamespaceLister interface {
	// List lists all QuarksStatefulSets in the indexer for a given namespace.
	List(selector labels.Selector) (ret []*v1alpha1.QuarksStatefulSet, err error)
	// Get retrieves the QuarksStatefulSet from the indexer for a given namespace and name.
	Get(name string) (*v1alpha1.QuarksStatefulSet, error)
	QuarksStatefulSetNamespaceListerExpansion
}

// quarksStatefulSetNamespaceLister implements the QuarksStatefulSetNamespaceLister
// interface.
type quarksStatefulSetNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

// List lists all QuarksStatefulSets in the indexer for a given namespace.
func (s quarksStatefulSetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.QuarksStatefulSet, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.QuarksStatefulSet))
	})
	return ret, err
}

// Get retrieves the QuarksStatefulSet from the indexer for a given namespace and name.
func (s quarksStatefulSetNamespaceLister) Get(name string) (*v1alpha1.QuarksStatefulSet, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("quarksstatefulset"), name)
	}
	return obj.(*v1alpha1.QuarksStatefulSet), nil
}
