Class TupleSchema.Builder

    • Method Detail

      • addField

        public TupleSchema.Builder addField​(java.lang.String fieldName,
                                            java.lang.Class fieldType)
        Adds a field name and type to the schema. Field names end up as both method names and field names in the generated class, therefore they have the same restrictions on allowable characters. Passing in an illegal name will cause a CompileException during the call to build.
        Parameters:
        fieldName - - Name of field
        fieldType - - Class type of field
        Returns:
        - TupleSchema.Builder
      • implementInterface

        public TupleSchema.Builder implementInterface​(java.lang.Class iface)
        The generated FastTuple subclass will implement the passed in interface. FastTuple's produced from this schema can then be cast to the interface type, for type safe invocation of the desired methods.
        Parameters:
        iface - - Class interface to implement
        Returns:
        - TupleSchema.Builder
      • addFieldNames

        public TupleSchema.Builder addFieldNames​(java.lang.Iterable<java.lang.String> fieldNames)
      • addFieldTypes

        public TupleSchema.Builder addFieldTypes​(java.lang.Iterable<java.lang.Class> fieldTypes)
      • poolOfSize

        public TupleSchema.Builder poolOfSize​(int poolSize)
        Sets the initial size for each thread local tuple pool. The total number of tuples that will be allocated can be found by multiplying this number by the number of threads that will be checking tuples out of the pool.
        Parameters:
        poolSize - - The size to generate specified in number of tuples.
        Returns:
        - TupleSchema.Builder
      • expandingPool

        public TupleSchema.Builder expandingPool()
        Specifies that the tuple pool should allocate more tuples when it becomes exhausted. Otherwise, an exhausted pool will throw an IllegalStateException.
        Returns:
        - TupleSchema.Builder