Request

class Request

General Request

General Request types establish some concept. They are always available without need to import.

Application classes and traits can have implicit conversions from General Request type to a local definition (for example).

Using general request singleton objects can make code more readable. There is no overhead because conversions are inlined.

   Time.current.roundTo(1.Second)(using UP)
   // vs.
   Time.current.roundTo(1.Second)(using Gen.Rounding.Up)

   Time.current.roundTo(1.Minute)(using DOWN)
   // vs.
   Time.current.roundTo(1.Minute)(using Gen.Rounding.Down)

   val b: Int.Buffer = NEW
   // vs.
   val b: Int.Buffer = Int.Buffer()

   val j: java.util.List[String] = NEW
   // vs.
   val j: java.util.List[String] = new java.util.ArrayList()

   val l: Long = MAX
   // vs.
   val l: Long = Long.max

   new Fx.Label("XYZ") {
      alignment = RIGHT
      // vs.
      alignment = Fx.Pos.CenterRight
   }

   new Fx.Pane.Split{
      orientation = VERTICAL
      // vs.
      orientation = Fx.Orientation.Vertical
   }

   new Fx.Menu {
      items += SEPARATOR
      // vs.
      items += Fx.Menu.Item.separator
   }

By far the most common request is VOID, which is a request for a void instance

var s: Stream[Int]  = VOID     // Assigning empty stream of Ints
var o: Opt[String]  = VOID     // Assigning empty optional value of String
var i: Long.Idx     = VOID     // Assigning empty indexed collection of Long
Source
__.scala
class java.lang.Object
trait scala.Matchable
class Any
class ALL
object ALL
class BOTTOM
object BOTTOM
class CENTER
object CENTER
class CURRENT
object CURRENT
class DEFAULT
object DEFAULT
class DOWN
object DOWN
class EMPTY
object EMPTY
object HORIZONTAL
class LEFT
object LEFT
class MAX
object MAX
class MIN
object MIN
class NEW
object NEW
class RIGHT
object RIGHT
class SEPARATOR
object SEPARATOR
class TOP
object TOP
class UP
object UP
class VERTICAL
object VERTICAL
class VOID
object VOID