scala.pickling

PBuilder

trait PBuilder extends Hintable

A builder of pickled content. This is a mutable API, intended to be called in certain specific ways.

Here are a few static rules that all picklers must follow when using this interface.

1. You will be given a type hint before any beginEntry() call. 2. There will be one endEntry() for every beginEntry() call. 3. There will be one endCollection() for every beginCollection() call. 4. Every beginCollection()/endCollection() pair will be inside a beginEntry()/endEntry() pair. 5. Every putElement() call must happen within a beginCollection()/endCollection() block. 6. Every putField() call must happen within a beginEntry()/endEntry() block. 7. There is no guarantee that putElement() will be called within a beginCollectoin()/endCollection() pair. i.e. we can write empty collections. 8. There is no guarantee that putField will be called within a beginEntry()/endEntry() pair. i.e. if we don't put any fields, this means the entry was for a "primitive" type, at least what The pickling library considers primitives. 9. The order of putField calls in any pickler will be the exact same ordering when unpickling, if the format is compatible.

Here is a list of all types the auto-generated Picklers considers "primitives" and must be directly supported by any PBuilder:

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PBuilder
  2. Hintable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def beginCollection(length: Int): PBuilder

    Denotes that a collection of elements is about to be pickled.

    Denotes that a collection of elements is about to be pickled.

    Note: This must be called after beginEntry()

    length

    The length of the collection being serialized.

    returns

    A pickler which can serialzie the collection.

  2. abstract def beginEntry(picklee: Any): PBuilder

    Called to denote that an object is about to be serialized.

    Called to denote that an object is about to be serialized.

    picklee

    The object to be serialized. This may be a primtiive, in which case it can be immediately serialized (or you can wait unitl endEntry is called).

    returns

    A pbuilder instance a pickler can use to serialize the picklee, if it's a complex type.

  3. abstract def endCollection(): Unit

    Denote that we are done serializing the collection.

  4. abstract def endEntry(): Unit

    Call this to denote that the given primitive, collection or structure being pickled is completed.

  5. abstract def hintDynamicallyElidedType(): PBuilder.this.type

    Definition Classes
    Hintable
  6. abstract def hintKnownSize(knownSize: Int): PBuilder.this.type

    Definition Classes
    Hintable
  7. abstract def hintOid(id: Int): PBuilder.this.type

    Definition Classes
    Hintable
  8. abstract def hintStaticallyElidedType(): PBuilder.this.type

    Definition Classes
    Hintable
  9. abstract def hintTag(tag: FastTypeTag[_]): PBuilder.this.type

    Definition Classes
    Hintable
  10. abstract def pinHints(): PBuilder.this.type

    Definition Classes
    Hintable
  11. abstract def popHints(): PBuilder.this.type

    Definition Classes
    Hintable
  12. abstract def pushHints(): PBuilder.this.type

    Definition Classes
    Hintable
  13. abstract def putElement(pickler: (PBuilder) ⇒ Unit): PBuilder

    Places the next element in the serialized collection.

    Places the next element in the serialized collection.

    Note: This must be called after beginCollection().

    pickler

    A callback which is passed a pickler able to serialize the item in the collection.

    returns

    A pickler which can serialize the next element of the collection.

  14. abstract def putField(name: String, pickler: (PBuilder) ⇒ Unit): PBuilder

    Serialize a "field" in a complex structure/object being pickled.

    Serialize a "field" in a complex structure/object being pickled.

    name

    The name of the field to serialize.

    pickler

    A callback which will be passed an appropriate pickler. You should ensure this function will perform a beginEntry()/endEntry() block.

    returns

    A builder for remaining items in the current complex structure being pickled.

  15. abstract def result(): Pickle

    Return the resulting pickle of this builder.

  16. abstract def unpinHints(): PBuilder.this.type

    Definition Classes
    Hintable

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def toString(): String

    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Hintable

Inherited from AnyRef

Inherited from Any

Ungrouped