Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/Option

Option

scala.Option
See theOption companion class
objectOption

Attributes

Companion
class
Source
Option.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
Option.type

Members list

Value members

Concrete methods

defapply[A](x:A):Option[A]

An Option factory which creates Some(x) if the argument is not null, and None if it is null.

An Option factory which creates Some(x) if the argument is not null, and None if it is null.

Value parameters

x

the value

Attributes

Returns

Some(value) if value != null, None if value == null

Source
Option.scala
defempty[A]:Option[A]

An Option factory which returnsNone in a manner consistent with the collections hierarchy.

An Option factory which returnsNone in a manner consistent with the collections hierarchy.

Attributes

Source
Option.scala
defunless[A](cond:Boolean)(a:=>A):Option[A]

Unless a given condition is true, this will evaluate thea argument and return Some(a).

Unless a given condition is true, this will evaluate thea argument and return Some(a). Otherwise,a is not evaluated and None is returned.

Attributes

Source
Option.scala
defwhen[A](cond:Boolean)(a:=>A):Option[A]

When a given condition is true, evaluates thea argument and returns Some(a).

When a given condition is true, evaluates thea argument and returns Some(a). When the condition is false,a is not evaluated and None is returned.

Attributes

Source
Option.scala

Implicits

Implicits

implicitdefoption2Iterable[A](xo:Option[A]):Iterable[A]

An implicit conversion that converts an option to an iterable value

An implicit conversion that converts an option to an iterable value

Attributes

Source
Option.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp