PositiveNumber

zio.blocks.schema.json.PositiveNumber
See thePositiveNumber companion class

Attributes

Companion
class
Source
JsonSchema.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(n: BigDecimal): Option[PositiveNumber]

Creates a PositiveNumber from a runtime BigDecimal value, returning Option.

Creates a PositiveNumber from a runtime BigDecimal value, returning Option.

Attributes

Source
JsonSchema.scala
def fromInt(n: Int): Option[PositiveNumber]

Attributes

Source
JsonSchema.scala
def unsafe(n: BigDecimal): PositiveNumber

Attributes

Source
JsonSchema.scala

Inherited methods

inline def literal(inline n: Int): PositiveNumber

Creates a PositiveNumber from a literal integer value, validated at compile time. Use this when the value is known at compile time for zero runtime overhead.

Creates a PositiveNumber from a literal integer value, validated at compile time. Use this when the value is known at compile time for zero runtime overhead.

import zio.blocks.schema.json.PositiveNumber

val mult: PositiveNumber = PositiveNumber.literal(5) // compiles
// PositiveNumber.literal(0)                         // does not compile

Attributes

Inherited from:
PositiveNumberCompanionVersionSpecific
Source
PositiveNumberCompanionVersionSpecific.scala