Packages

object RequireTypes

Encapsulates those classes and their utility methods which enforce a given invariant via the use of require.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RequireTypes
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class ExistingFile(file: File) extends NoCopy with Product with Serializable
  2. sealed trait LengthLimitedString extends NoCopy

    This trait wraps a String that is limited to a certain maximum length.

    This trait wraps a String that is limited to a certain maximum length. Classes implementing this trait expose create and tryCreate methods to safely (and non-safely) construct such a String.

    The canonical use case for LengthLimitedString's is ensuring that we don't write too long strings into the database: Oracle has a length-limit of 1000 Unicode characters for the ordinary String type NVARCHAR2 and we are trying to avoid the use of CLOB (as it has pitfalls regarding implicits). This validation generally occurs on the server side and not on the client side. Concretely, this means that the Admin API and Ledger API gRPC services is the point where we validate that the received Protobuf Strings are not too long (and convert them into LengthLimitedStrings). On the client side, e.g. at the console, we generally take normal String types. The console command set_display_name and service GrpcPartyNameManagementService validating request.displayName illustrate this.

    As a rule of thumb: whenever you want to create a column that uses a NVARCHAR2 in Oracle, the value you write to it should use a LengthLimitedString.

    Some more background on the Oracle issues: NVARCHAR and NVARCHAR2 have both by default a 4000 byte limit, but unicode uses 4-bytes per character (and nvarchar2 uses unicode) Therefore, NVARCHAR has a limit of 4000 and NVARCHAR2 has a limit of 1000 characters If need be, we can extend this to 32 KB by setting the Oracle database string size to 'extended mode' (ALTER SYSTEM SET MAX_STRING_SIZE=EXTENDED)

    CLOB is only used for the following values (none are indices): - V1_1 source_description - v4 agreement_text - v8 ignore_reason - v13 connection_uri - v28_1 error_message

  3. trait LengthLimitedStringCompanion[A <: LengthLimitedString] extends AnyRef

    Trait that implements method commonly needed in the companion object of a LengthLimitedString

  4. final case class LengthLimitedStringVar(str: String, maxLength: Int)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable
  5. trait LengthLimitedStringWrapper extends AnyRef

    Trait for case classes that are a wrapper around a LengthLimitedString.

    Trait for case classes that are a wrapper around a LengthLimitedString.

    See also

    com.digitalasset.canton.crypto.CertificateId for an example

  6. trait LengthLimitedStringWrapperCompanion[A <: LengthLimitedString, Wrapper <: LengthLimitedStringWrapper] extends AnyRef

    Trait that implements utility methods to avoid boilerplate in the companion object of a case class that wraps a LengthLimitedString type using LengthLimitedStringWrapper.

    Trait that implements utility methods to avoid boilerplate in the companion object of a case class that wraps a LengthLimitedString type using LengthLimitedStringWrapper.

    See also

    com.digitalasset.canton.crypto.CertificateId for an example

  7. final case class NonEmptyString(str: String) extends NoCopy with Product with Serializable
  8. type NonNegativeInt = NonNegativeNumeric[Int]
  9. sealed abstract case class NonNegativeNumeric[T] extends RefinedNumeric[T] with Product with Serializable
  10. final case class Port(n: Int) extends Ordered[Port] with PrettyPrinting with NoCopy with Product with Serializable
  11. type PositiveInt = PositiveNumeric[Int]
  12. sealed abstract case class PositiveNumeric[T] extends RefinedNumeric[T] with Product with Serializable
  13. sealed trait RefinedNumeric[T] extends Ordered[RefinedNumeric[T]] with PrettyPrinting
  14. final case class String185(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Limit used by com.digitalasset.canton.topology.Identifier.

    See also

    com.digitalasset.canton.topology.Identifier for documentation on its origin

  15. final case class String255(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Default LengthLimitedString that should be used when in doubt.

    Default LengthLimitedString that should be used when in doubt. 255 was chosen as it is also the limit used in the upstream code for, e.g., LedgerStrings in the upstream code

    name

    optionally set it to improve the error message. It is given as an extra argument, so the automatically generated equals-method doesn't use it for comparison

  16. final case class String3(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Limit used for enum names.

  17. final case class String300(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Longest limited-length strings that have been needed so far.

    Longest limited-length strings that have been needed so far. Typical use case: when a 255-length identifier is combined with other short suffixes or prefixes to further specialize them.

    See also

    com.digitalasset.canton.store.db.SequencerClientDiscriminator

    com.digitalasset.canton.crypto.KeyName

  18. final case class String36(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Limit used by a UUID.

  19. final case class String68(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Limit used by a hash (SHA256 in particular) in a com.digitalasset.canton.topology.UniqueIdentifier.

    Limit used by a hash (SHA256 in particular) in a com.digitalasset.canton.topology.UniqueIdentifier.

    See also

    com.digitalasset.canton.topology.UniqueIdentifier for documentation on its origin

  20. final case class String73(str: String)(name: Option[String] = None) extends LengthLimitedString with Product with Serializable

    Limit used by a com.digitalasset.canton.sequencing.protocol.MessageId.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. object ExistingFile extends Serializable
  20. object LengthLimitedString
  21. object LengthLimitedStringVar extends Serializable
  22. object NonEmptyString extends Serializable
  23. object NonNegativeInt
  24. object NonNegativeNumeric extends Serializable
  25. object Port extends Serializable
  26. object PositiveInt
  27. object PositiveNumeric extends Serializable
  28. object String185 extends LengthLimitedStringCompanion[String185] with Serializable
  29. object String255 extends LengthLimitedStringCompanion[String255] with Serializable
  30. object String3 extends LengthLimitedStringCompanion[String3] with Serializable
  31. object String300 extends LengthLimitedStringCompanion[String300] with Serializable
  32. object String36 extends LengthLimitedStringCompanion[String36] with Serializable
  33. object String68 extends LengthLimitedStringCompanion[String68] with Serializable
  34. object String73 extends LengthLimitedStringCompanion[String73] with Serializable

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped