c

com.twitter.scrooge

StructBuilder

abstract class StructBuilder[T <: ThriftStruct] extends AnyRef

A class that provides an interface for building a new ThriftStruct from an existing ThriftStruct or statically from T.

We pass in a list of ClassTags which describe each of the struct's field types so that we can validate the values we are setting at runtime.

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

Instance Constructors

  1. new StructBuilder(fieldTypes: IndexedSeq[ClassTag[_]])

Abstract Value Members

  1. abstract def build(): T

    Build a new ThriftStruct after setting the desired fields.

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 clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. val fieldArray: Array[Any]
    Attributes
    protected
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  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()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def setAllFields(fields: Seq[Any])(implicit tag: ClassTag[T]): StructBuilder[T]

    Set all of the fields of the new ThriftStruct.

    Set all of the fields of the new ThriftStruct. A value must be present for all fields required to construct the ThriftStruct and in the correct order.

    fields

    a sequence of values ordered by field index.

  17. def setField(index: Int, value: Any): StructBuilder[T]

    Set the field at index with value.

    Set the field at index with value.

    When called on a builder that was created from an existing instance of T, all the other fields will be the same as that struct.

    When called on a static builder, the other fields will not have defaults so the caller must ensure that all the other fields are set before calling build().

    index

    the index of the field list for the ThriftStruct.

    value

    the value to use for the field in ThriftStruct.

  18. def structBuildError(structName: String): String

    The error message used when build() throws an InvalidFieldsException when values are not present in the fieldArray or when the values are invalid.

    The error message used when build() throws an InvalidFieldsException when values are not present in the fieldArray or when the values are invalid.

    structName

    the name of the ThriftStruct to include in the error message.

    Attributes
    protected
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  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()

Inherited from AnyRef

Inherited from Any

Ungrouped