Skip to content

Commit

Permalink
Rehide value utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
losizm committed Jan 8, 2024
1 parent a2fe02c commit fc381c1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/scamper/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@
*/
package scamper

inline def notNull[T](value: T): T =
private inline def notNull[T](value: T): T =
if value == null then
throw NullPointerException()
value

inline def notNull[T](value: T, message: => String): T =
private inline def notNull[T](value: T, message: => String): T =
if value == null then
throw NullPointerException(message)
value

inline def noNulls[T <: Option[?]](value: T): T =
private inline def noNulls[T <: Option[?]](value: T): T =
if value == null || value.contains(null) then
throw NullPointerException()
value

inline def noNulls[T <: Option[?]](value: T, message: => String): T =
private inline def noNulls[T <: Option[?]](value: T, message: => String): T =
if value == null || value.contains(null) then
throw NullPointerException(message)
value

inline def noNulls[T <: Seq[?]](values: T): T =
private inline def noNulls[T <: Seq[?]](values: T): T =
if values == null || values.contains(null) then
throw NullPointerException()
values

inline def noNulls[T <: Seq[?]](values: T, message: => String): T =
private inline def noNulls[T <: Seq[?]](values: T, message: => String): T =
if values == null || values.contains(null) then
throw NullPointerException(message)
values

0 comments on commit fc381c1

Please sign in to comment.