object PosLong
The companion object for PosLong that offers
factory methods that produce PosLongs, implicit
widening conversions from PosLong to other
numeric types, and maximum and minimum constant values for
PosLong.
- Source
- PosLong.scala
- Alphabetic
- By Inheritance
- PosLong
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
-   final  def !=(arg0: Any): Boolean- Definition Classes
- AnyRef → Any
 
-   final  def ##: Int- Definition Classes
- AnyRef → Any
 
-   final  def ==(arg0: Any): Boolean- Definition Classes
- AnyRef → Any
 
-   final  val MaxValue: PosLongThe largest value representable as a positive Long, which isPosLong(9223372036854775807).
-   final  val MinValue: PosLongThe smallest value representable as a positive Long, which isPosLong(1L).
-   implicit macro  def apply(value: Long): PosLongA factory method, implemented via a macro, that produces a PosLongif passed a validLongliteral, otherwise a compile time error.A factory method, implemented via a macro, that produces a PosLongif passed a validLongliteral, otherwise a compile time error.The macro that implements this method will inspect the specified Longexpression at compile time. If the expression is a positiveLongliteral, it will return aPosLongrepresenting that value. Otherwise, the passedLongexpression is either a literal that is not positive, or is not a literal, so this method will give a compiler error.This factory method differs from the fromfactory method in that this method is implemented via a macro that inspectsLongliterals at compile time, whereasfrominspectsLongvalues at run time.- value
- the - Longliteral expression to inspect at compile time, and if positive, to return wrapped in a- PosLongat run time.
- returns
- the specified, valid - Longliteral value wrapped in a- PosLong. (If the specified expression is not a valid- Longliteral, the invocation of this method will not compile.)
 
-   final  def asInstanceOf[T0]: T0- Definition Classes
- Any
 
-    def clone(): AnyRef- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
 
-    def ensuringValid(value: Long): PosLongA factory/assertion method that produces an PosLonggiven a validLongvalue, or throwsAssertionError, if given an invalidLongvalue.A factory/assertion method that produces an PosLonggiven a validLongvalue, or throwsAssertionError, if given an invalidLongvalue.Note: you should use this method only when you are convinced that it will always succeed, i.e., never throw an exception. It is good practice to add a comment near the invocation of this method indicating why you think it will always succeed to document your reasoning. If you are not sure an ensuringValidcall will always succeed, you should use one of the other factory or validation methods provided on this object instead:isValid,tryingValid,passOrElse,goodOrElse, orrightOrElse.This method will inspect the passed Longvalue and if it is a positiveLong, it will return aPosLongrepresenting that value. Otherwise, the passedLongvalue is not positive, so this method will throwAssertionError.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsLongliterals at compile time, whereasfrominspectsLongvalues at run time. It differs from a vanillaassertorensuringcall in that you get something you didn't already have if the assertion succeeds: a type that promises aLongis positive.- value
- the - Longto inspect, and if positive, return wrapped in a- PosLong.
- returns
- the specified - Longvalue wrapped in a- PosLong, if it is positive, else throws- AssertionError.
 - Exceptions thrown
- AssertionErrorif the passed value is not positive
 
-   final  def eq(arg0: AnyRef): Boolean- Definition Classes
- AnyRef
 
-    def equals(arg0: AnyRef): Boolean- Definition Classes
- AnyRef → Any
 
-    def finalize(): Unit- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
 
-    def from(value: Long): Option[PosLong]A factory method that produces an Option[PosLong]given aLongvalue.A factory method that produces an Option[PosLong]given aLongvalue.This method will inspect the passed Longvalue and if it is a positiveLong, it will return aPosLongrepresenting that value, wrapped in aSome. Otherwise, the passedLongvalue is not positive, so this method will returnNone.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsLongliterals at compile time, whereasfrominspectsLongvalues at run time.- value
- the - Longto inspect, and if positive, return wrapped in a- Some[PosLong].
- returns
- the specified - Longvalue wrapped in a- Some[PosLong], if it is positive, else- None.
 
-    def fromOrElse(value: Long, default: => PosLong): PosLongA factory method that produces a PosLonggiven aLongvalue and a defaultPosLong.A factory method that produces a PosLonggiven aLongvalue and a defaultPosLong.This method will inspect the passed Longvalue and if it is a positiveLong, it will return aPosLongrepresenting that value. Otherwise, the passedLongvalue is not positive, so this method will return the passeddefaultvalue.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsLongliterals at compile time, whereasfrominspectsLongvalues at run time.- value
- the - Longto inspect, and if positive, return.
- default
- the - PosLongto return if the passed- Longvalue is not positive.
- returns
- the specified - Longvalue wrapped in a- PosLong, if it is positive, else the- default- PosLongvalue.
 
-   final  def getClass(): Class[_ <: AnyRef]- Definition Classes
- AnyRef → Any
- Annotations
- @native()
 
-    def goodOrElse[B](value: Long)(f: (Long) => B): Or[PosLong, B]A factory/validation method that produces a PosLong, wrapped in aGood, given a validLongvalue, or if the givenLongis invalid, an error value of typeBproduced by passing the given invalidLongvalue to the given functionf, wrapped in aBad.A factory/validation method that produces a PosLong, wrapped in aGood, given a validLongvalue, or if the givenLongis invalid, an error value of typeBproduced by passing the given invalidLongvalue to the given functionf, wrapped in aBad.This method will inspect the passed Longvalue and if it is a positiveLong, it will return aPosLongrepresenting that value, wrapped in aGood. Otherwise, the passedLongvalue is not positive, so this method will return a result of typeBobtained by passing the invalidLongvalue to the given functionf, wrapped in aBad.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsLongliterals at compile time, whereas this method inspectsLongvalues at run time.- value
- the - Longto inspect, and if positive, return wrapped in a- Good(PosLong).
- returns
- the specified - Longvalue wrapped in a- Good(PosLong), if it is positive, else a- Bad(f(value)).
 
-    def hashCode(): Int- Definition Classes
- AnyRef → Any
- Annotations
- @native()
 
-   final  def isInstanceOf[T0]: Boolean- Definition Classes
- Any
 
-    def isValid(value: Long): BooleanA predicate method that returns true if a given Longvalue is positive.A predicate method that returns true if a given Longvalue is positive.- value
- the - Longto inspect, and if positive, return true.
- returns
- true if the specified - Longis positive, else false.
 
-   final  def ne(arg0: AnyRef): Boolean- Definition Classes
- AnyRef
 
-   final  def notify(): Unit- Definition Classes
- AnyRef
- Annotations
- @native()
 
-   final  def notifyAll(): Unit- Definition Classes
- AnyRef
- Annotations
- @native()
 
-   implicit  val ordering: Ordering[PosLong]Implicit Ordering instance. 
-    def passOrElse[E](value: Long)(f: (Long) => E): Validation[E]A validation method that produces a Passgiven a validLongvalue, or an error value of typeEproduced by passing the given invalidIntvalue to the given functionf, wrapped in aFail.A validation method that produces a Passgiven a validLongvalue, or an error value of typeEproduced by passing the given invalidIntvalue to the given functionf, wrapped in aFail.This method will inspect the passed Longvalue and if it is a positiveLong, it will return aPass. Otherwise, the passedLongvalue is positive, so this method will return a result of typeEobtained by passing the invalidLongvalue to the given functionf, wrapped in aFail.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsLongliterals at compile time, whereas this method inspectsLongvalues at run time.- value
- the - Longto validate that it is positive.
- returns
- a - Passif the specified- Longvalue is positive, else a- Failcontaining an error value produced by passing the specified- Longto the given function- f.
 
-    def rightOrElse[L](value: Long)(f: (Long) => L): Either[L, PosLong]A factory/validation method that produces a PosLong, wrapped in aRight, given a validIntvalue, or if the givenIntis invalid, an error value of typeLproduced by passing the given invalidIntvalue to the given functionf, wrapped in aLeft.A factory/validation method that produces a PosLong, wrapped in aRight, given a validIntvalue, or if the givenIntis invalid, an error value of typeLproduced by passing the given invalidIntvalue to the given functionf, wrapped in aLeft.This method will inspect the passed Intvalue and if it is a positiveInt, it will return aPosLongrepresenting that value, wrapped in aRight. Otherwise, the passedIntvalue is not positive, so this method will return a result of typeLobtained by passing the invalidIntvalue to the given functionf, wrapped in aLeft.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsIntliterals at compile time, whereas this method inspectsIntvalues at run time.- value
- the - Intto inspect, and if positive, return wrapped in a- Right(PosLong).
- returns
- the specified - Intvalue wrapped in a- Right(PosLong), if it is positive, else a- Left(f(value)).
 
-   final  def synchronized[T0](arg0: => T0): T0- Definition Classes
- AnyRef
 
-    def toString(): String- Definition Classes
- AnyRef → Any
 
-    def tryingValid(value: Long): Try[PosLong]A factory/validation method that produces a PosLong, wrapped in aSuccess, given a validLongvalue, or if the givenLongis invalid, anAssertionError, wrapped in aFailure.A factory/validation method that produces a PosLong, wrapped in aSuccess, given a validLongvalue, or if the givenLongis invalid, anAssertionError, wrapped in aFailure.This method will inspect the passed Longvalue and if it is a positiveLong, it will return aPosLongrepresenting that value, wrapped in aSuccess. Otherwise, the passedLongvalue is not positive, so this method will return anAssertionError, wrapped in aFailure.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsLongliterals at compile time, whereas this method inspectsLongvalues at run time.- value
- the - Longto inspect, and if positive, return wrapped in a- Success(PosLong).
- returns
- the specified - Longvalue wrapped in a- Success(PosLong), if it is positive, else a- Failure(AssertionError).
 
-   final  def wait(): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
 
-   final  def wait(arg0: Long, arg1: Int): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
 
-   final  def wait(arg0: Long): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
 
-   implicit  def widenToDouble(pos: PosLong): DoubleImplicit widening conversion from PosLongtoDouble.Implicit widening conversion from PosLongtoDouble.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Double.
 
-   implicit  def widenToFloat(pos: PosLong): FloatImplicit widening conversion from PosLongtoFloat.Implicit widening conversion from PosLongtoFloat.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Float.
 
-   implicit  def widenToLong(pos: PosLong): LongImplicit widening conversion from PosLongtoLong.Implicit widening conversion from PosLongtoLong.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong.
 
-   implicit  def widenToNonZeroDouble(pos: PosLong): NonZeroDoubleImplicit widening conversion from PosLongtoNonZeroDouble.Implicit widening conversion from PosLongtoNonZeroDouble.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Doubleand wrapped in a- NonZeroDouble.
 
-   implicit  def widenToNonZeroFloat(pos: PosLong): NonZeroFloatImplicit widening conversion from PosLongtoNonZeroFloat.Implicit widening conversion from PosLongtoNonZeroFloat.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Floatand wrapped in a- NonZeroFloat.
 
-   implicit  def widenToNonZeroLong(pos: PosLong): NonZeroLongImplicit widening conversion from PosLongtoNonZeroLong.Implicit widening conversion from PosLongtoNonZeroLong.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Longand wrapped in a- NonZeroLong.
 
-   implicit  def widenToPosDouble(pos: PosLong): PosDoubleImplicit widening conversion from PosLongtoPosDouble.Implicit widening conversion from PosLongtoPosDouble.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Doubleand wrapped in a- PosDouble.
 
-   implicit  def widenToPosFloat(pos: PosLong): PosFloatImplicit widening conversion from PosLongtoPosFloat.Implicit widening conversion from PosLongtoPosFloat.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Floatand wrapped in a- PosFloat.
 
-   implicit  def widenToPosZDouble(pos: PosLong): PosZDoubleImplicit widening conversion from PosLongtoPosZDouble.Implicit widening conversion from PosLongtoPosZDouble.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Doubleand wrapped in a- PosZDouble.
 
-   implicit  def widenToPosZFloat(pos: PosLong): PosZFloatImplicit widening conversion from PosLongtoPosZFloat.Implicit widening conversion from PosLongtoPosZFloat.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Floatand wrapped in a- PosZFloat.
 
-   implicit  def widenToPosZLong(pos: PosLong): PosZLongImplicit widening conversion from PosLongtoPosZLong.Implicit widening conversion from PosLongtoPosZLong.- pos
- the - PosLongto widen
- returns
- the - Longvalue underlying the specified- PosLong, widened to- Longand wrapped in a- PosZLong.
 
Deprecated Value Members
-    val posLongOrd: Ordering[PosLong]The formerly implicit posLongOrdfield has been deprecated and will be removed in a future version of ScalaTest. Please use theorderingfield instead.The formerly implicit posLongOrdfield has been deprecated and will be removed in a future version of ScalaTest. Please use theorderingfield instead.- Annotations
- @deprecated
- Deprecated
- The formerly implicit posLongOrd field has been deprecated and will be removed in a future version of ScalaTest. Please use the ordering field instead.