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.
- Alphabetic
- By Inheritance
- StructBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new StructBuilder(fieldTypes: IndexedSeq[ClassTag[_]])
Abstract Value Members
- abstract def build(): T
Build a new ThriftStruct after setting the desired fields.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val fieldArray: Array[Any]
- Attributes
- protected
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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.
- def setField(index: Int, value: Any): StructBuilder[T]
Set the field at
indexwithvalue.Set the field at
indexwithvalue.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.
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()