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

package v1alpha1

import (
	v1alpha1 "github.com/openshift/api/sharedresource/v1alpha1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// SharedConfigMapLister helps list SharedConfigMaps.
// All objects returned here must be treated as read-only.
type SharedConfigMapLister interface {
	// List lists all SharedConfigMaps in the indexer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*v1alpha1.SharedConfigMap, err error)
	// Get retrieves the SharedConfigMap from the index for a given name.
	// Objects returned here must be treated as read-only.
	Get(name string) (*v1alpha1.SharedConfigMap, error)
	SharedConfigMapListerExpansion
}

// sharedConfigMapLister implements the SharedConfigMapLister interface.
type sharedConfigMapLister struct {
	indexer cache.Indexer
}

// NewSharedConfigMapLister returns a new SharedConfigMapLister.
func NewSharedConfigMapLister(indexer cache.Indexer) SharedConfigMapLister {
	return &sharedConfigMapLister{indexer: indexer}
}

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

// Get retrieves the SharedConfigMap from the index for a given name.
func (s *sharedConfigMapLister) Get(name string) (*v1alpha1.SharedConfigMap, error) {
	obj, exists, err := s.indexer.GetByKey(name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("sharedconfigmap"), name)
	}
	return obj.(*v1alpha1.SharedConfigMap), nil
}
