t

com.digitalasset.canton.version

HasProtocolVersionedWrapper

trait HasProtocolVersionedWrapper[ValueClass] extends HasRepresentativeProtocolVersion

Trait for classes that can be serialized by using ProtoBuf. See "CONTRIBUTING.md" for our guidelines on serialization.

This wrapper is to be used when every instance can be tied to a single protocol version. Consequently, some attributes of the class may depend on the protocol version (e.g., the signature). The protocol version is then bundled with the instance and does not need to be passed to the toProtoVersioned, toByteString and getCryptographicEvidence methods.

The underlying ProtoClass is com.digitalasset.canton.version.UntypedVersionedMessage but we often specify the typed alias com.digitalasset.canton.version.VersionedMessage instead.

Self Type
HasProtocolVersionedWrapper[ValueClass] with ValueClass
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HasProtocolVersionedWrapper
  2. HasRepresentativeProtocolVersion
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract val companionObj: HasProtocolVersionedWrapperCompanion[ValueClass, _]
    Attributes
    protected
    Definition Classes
    HasProtocolVersionedWrapperHasRepresentativeProtocolVersion
    Annotations
    @transient()
  2. abstract def representativeProtocolVersion: RepresentativeProtocolVersion[(HasProtocolVersionedWrapper.this)#companionObj.type]

    We have a correspondence {Proto version} <-> {[protocol version]}: each proto version correspond to a list of consecutive protocol versions.

    We have a correspondence {Proto version} <-> {[protocol version]}: each proto version correspond to a list of consecutive protocol versions. The representative is one instance of this list, usually the smallest value. In other words, the Proto versions induce an equivalence relation on the list of protocol version, thus use of representative.

    The method protocolVersionRepresentativeFor below allows to query the representative for an equivalence class.

    Definition Classes
    HasRepresentativeProtocolVersion

Concrete 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 castRepresentativeProtocolVersion[T <: HasSupportedProtoVersions[_]](target: T): Either[String, RepresentativeProtocolVersion[T]]

    Casts this instance's representative protocol version to one for the target type.

    Casts this instance's representative protocol version to one for the target type. This only succeeds if the versioning schemes are the same.

    Annotations
    @SuppressWarnings()
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def isEquivalentTo(protocolVersion: ProtocolVersion): Boolean
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def protoVersion: ProtoVersion

    Yields the Proto version that this class will be serialized to

  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toByteArray: Array[Byte]

    Yields a byte array representation of the corresponding UntypedVersionedMessage wrapper of this instance.

  19. def toByteString: ByteString

    Yields a byte string representation of the corresponding UntypedVersionedMessage wrapper of this instance.

  20. def toProtoVersioned: VersionedMessage[ValueClass]

    Yields the proto representation of the class inside an UntypedVersionedMessage wrapper.

    Yields the proto representation of the class inside an UntypedVersionedMessage wrapper.

    Subclasses should make this method public by default, as this supports composing proto serializations. Keep it protected, if there are good reasons for it (e.g. com.digitalasset.canton.serialization.ProtocolVersionedMemoizedEvidence).

    Be aware that if calling on a class that defines a LegacyProtoConverter, this method will still return a VersionedMessage. If the current protocol version maps to the legacy converter, deserialization will then fail (as it will try to deserialize to the raw protobuf instead of the VersionedMessage wrapper this was serialized to. Prefer using toByteString which handles this use case correctly.

  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. def writeToFile(outputFile: String): Unit

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