Class

com.twitter.scrooge

StructBuilder

Related Doc: package scrooge

Permalink

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. All

Instance Constructors

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

    Permalink

Abstract Value Members

  1. abstract def build(): T

    Permalink

    Build a new ThriftStruct after setting the desired fields.

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. val fieldArray: Array[Any]

    Permalink
    Attributes
    protected
  9. def finalize(): Unit

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. def setAllFields(fields: Seq[Any])(implicit tag: ClassTag[T]): StructBuilder[T]

    Permalink

    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]

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped