org.xcmis.search.content
Class InMemorySchema.Builder

java.lang.Object
  extended by org.xcmis.search.content.InMemorySchema.Builder
Enclosing class:
InMemorySchema

public static class InMemorySchema.Builder
extends Object

A builder of immutable Schema objects.


Constructor Summary
protected InMemorySchema.Builder()
           
 
Method Summary
 InMemorySchema.Builder addColumn(String tableName, String columnName, PropertyType type)
          Add a column with the supplied name and type to the named table.
 InMemorySchema.Builder addColumn(String tableName, String columnName, PropertyType type, boolean fullTextSearchable, org.xcmis.search.model.constraint.Operator[] availableQueryOperators)
          Add a column with the supplied name and type to the named table.
 InMemorySchema.Builder addTable(String name, String... columnNames)
          Add a table with the supplied name and column names.
 InMemorySchema.Builder addTable(String name, String[] columnNames, PropertyType[] types)
          Add a table with the supplied name and column names and types.
 Schema build()
          Build the Schema instance, using the current state of the builder.
 InMemorySchema.Builder makeSearchable(String tableName, String columnName)
          Make sure the column on the named table is searchable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemorySchema.Builder

protected InMemorySchema.Builder()
Method Detail

addTable

public InMemorySchema.Builder addTable(String name,
                                       String... columnNames)
Add a table with the supplied name and column names. Each column will be given a default type. The table will also overwrite any existing table definition with the same name.

Parameters:
name - the name of the new table
columnNames - the names of the columns.
Returns:
this builder, for convenience in method chaining; never null

addTable

public InMemorySchema.Builder addTable(String name,
                                       String[] columnNames,
                                       PropertyType[] types)
Add a table with the supplied name and column names and types. The table will also overwrite any existing table definition with the same name.

Parameters:
name - the name of the new table
columnNames - the names of the columns
types - the types for the columns
Returns:
this builder, for convenience in method chaining; never null

addColumn

public InMemorySchema.Builder addColumn(String tableName,
                                        String columnName,
                                        PropertyType type)
Add a column with the supplied name and type to the named table. Any existing column with that name will be replaced with the new column. If the table does not yet exist, it will be added.

Parameters:
tableName - the name of the new table
columnName - the names of the column
type - the type for the column
Returns:
this builder, for convenience in method chaining; never null

addColumn

public InMemorySchema.Builder addColumn(String tableName,
                                        String columnName,
                                        PropertyType type,
                                        boolean fullTextSearchable,
                                        org.xcmis.search.model.constraint.Operator[] availableQueryOperators)
Add a column with the supplied name and type to the named table. Any existing column with that name will be replaced with the new column. If the table does not yet exist, it will be added.

Parameters:
tableName - the name of the new table
columnName - the names of the column
type - the type for the column
fullTextSearchable - true if the column should be full-text searchable, or false if not
Returns:
this builder, for convenience in method chaining; never null

makeSearchable

public InMemorySchema.Builder makeSearchable(String tableName,
                                             String columnName)
Make sure the column on the named table is searchable.

Parameters:
tableName - the name of the new table
columnName - the names of the column
Returns:
this builder, for convenience in method chaining; never null

build

public Schema build()
Build the Schema instance, using the current state of the builder. This method creates a snapshot of the tables (with their columns) as they exist at the moment this method is called.

Returns:
the new Schema; never null


Copyright © 2011 eXo Platform SAS. All Rights Reserved.