Skip to content

Commit

Permalink
[backport] SI-8705 Added example to Option.contains method.
Browse files Browse the repository at this point in the history
(cherry picked from commit 1e2a216)
  • Loading branch information
jxcoder authored and gourlaysama committed Aug 11, 2014
1 parent f18db59 commit 1c96ed5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/library/scala/Option.scala
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ sealed abstract class Option[+A] extends Product with Serializable {
}

/** Tests whether the option contains a given value as an element.
*
* @example {{{
* // Returns true because Some instance contains string "something" which equals "something".
* Some("something") contains "something"
*
* // Returns false because "something" != "anything".
* Some("something") contains "anything"
*
* // Returns false when method called on None.
* None contains "anything"
* }}}
*
* @param elem the element to test.
* @return `true` if the option has an element that is equal (as
Expand Down

0 comments on commit 1c96ed5

Please sign in to comment.