NonEmptySet

izumi.fundamentals.collections.nonempty.NonEmptySet$
See theNonEmptySet companion class

Companion object for class NonEmptySet.

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

final implicit class OptionOps[A](option: Option[NonEmptySet[A]]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def apply[T](firstElement: T, otherElements: T*): NonEmptySet[T]

Constructs a new NonEmptySet given at least one element.

Constructs a new NonEmptySet given at least one element.

Attributes

T

the type of the element contained in the new NonEmptySet

firstElement

the first element (with index 0) contained in this NonEmptySet

otherElements

a varargs of zero or more other elements (with index 1, 2, 3, ...) contained in this NonEmptySet

def from[T](set: Set[T]): Option[NonEmptySet[T]]

Optionally construct a NonEmptySet containing the elements, if any, of a given Set.

Optionally construct a NonEmptySet containing the elements, if any, of a given Set.

Attributes

set

the Set with which to construct a NonEmptySet

Returns:

a NonEmptySet containing the elements of the given GenSeq, if non-empty, wrapped in a Some; else None if the GenSeq is empty

def unapplySeq[T](nonEmptySet: NonEmptySet[T]): Some[Seq[T]]

Variable argument extractor for NonEmptySets.

Variable argument extractor for NonEmptySets.

Attributes

nonEmptySet:

the NonEmptySet containing the elements to extract

Returns:

an Seq containing this NonEmptySets elements, wrapped in a Some

def unsafeFrom[T](set: Set[T]): NonEmptySet[T]

Implicits

Implicits

final implicit def OptionOps[A](option: Option[NonEmptySet[A]]): OptionOps[A]