github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/predicate/one/api.go (about)

     1  // Package one provides predicate builders
     2  package one
     3  
     4  import (
     5  	"github.com/m4gshm/gollections/collection/immutable/set"
     6  	"github.com/m4gshm/gollections/predicate"
     7  )
     8  
     9  // Of creates a predicate that can be used to compare a value with predefined expected values
    10  func Of[T comparable](expected ...T) predicate.Predicate[T] {
    11  	return set.Of(expected...).Contains
    12  }