public static class Schema.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Schema.Builder |
addColumn(String name,
ColumnMetaData metaData)
Add a column
|
Schema.Builder |
addColumnCategorical(String name,
List<String> stateNames)
Add a Categorical column, with the specified state names
|
Schema.Builder |
addColumnCategorical(String name,
String... stateNames)
Add a Categorical column, with the specified state names
|
Schema.Builder |
addColumnDouble(String name)
Add a Double column with no restrictions on the allowable values, except for no NaN/infinite values allowed
|
Schema.Builder |
addColumnDouble(String name,
Double minAllowedValue,
Double maxAllowedValue)
Add a Double column with the specified restrictions (and no NaN/Infinite values allowed)
|
Schema.Builder |
addColumnDouble(String name,
Double minAllowedValue,
Double maxAllowedValue,
boolean allowNaN,
boolean allowInfinite)
Add a double column with the specified restrictions
|
Schema.Builder |
addColumnInteger(String name)
Add an integer column with no restrictions on the allowable values
|
Schema.Builder |
addColumnInteger(String name,
Integer minAllowedValue,
Integer maxAllowedValue)
Add an integer column with the specified min/max allowable values
|
Schema.Builder |
addColumnLong(String name)
Add a Long column, with no restrictions on the min/max values
|
Schema.Builder |
addColumnLong(String name,
Long minAllowedValue,
Long maxAllowedValue)
Add an Long column with the specified min/max allowable values
|
Schema.Builder |
addColumnsDouble(String... columnNames)
Add multiple columns with no restrictions on the allowable values of the columns (other than no NaN/Infinite)
|
Schema.Builder |
addColumnsInteger(String... names)
Add multiple Integer columns with no restrictions on the min/max allowable values
|
Schema.Builder |
addColumnsLong(String... names)
Add multiple long columns, with no restrictions on the allowable values
|
Schema.Builder |
addColumnsString(String... columnNames)
Add String columns with no restrictions on the allowable values
|
Schema.Builder |
addColumnString(String name)
Add a String column with no restrictions on the allowable values.
|
Schema.Builder |
addColumnString(String name,
String regex,
Integer minAllowableLength,
int maxAllowableLength)
Add a String column with the specified restrictions
|
Schema.Builder |
addColumnTime(String columnName,
org.joda.time.DateTimeZone timeZone)
Add a Time column with no restrictions on the min/max allowable times
NOTE: Time columns are represented by LONG (epoch millisecond) values.
|
Schema.Builder |
addColumnTime(String columnName,
org.joda.time.DateTimeZone timeZone,
Long minValidValue,
Long maxValidValue)
Add a Time column with the specified restrictions
NOTE: Time columns are represented by LONG (epoch millisecond) values.
|
Schema.Builder |
addColumnTime(String columnName,
TimeZone timeZone)
Add a Time column with no restrictions on the min/max allowable times
NOTE: Time columns are represented by LONG (epoch millisecond) values.
|
Schema |
build()
Create the Schema
|
public Schema.Builder addColumnDouble(String name)
name
- Name of the columnpublic Schema.Builder addColumnDouble(String name, Double minAllowedValue, Double maxAllowedValue)
name
- Name of the columnminAllowedValue
- Minimum allowed value (inclusive). If null: no restrictionmaxAllowedValue
- Maximum allowed value (inclusive). If null: no restrictionpublic Schema.Builder addColumnDouble(String name, Double minAllowedValue, Double maxAllowedValue, boolean allowNaN, boolean allowInfinite)
name
- Name of the columnminAllowedValue
- Minimum allowed value (inclusive). If null: no restrictionmaxAllowedValue
- Maximum allowed value (inclusive). If null: no restrictionallowNaN
- If false: don't allow NaN values. If true: allow.allowInfinite
- If false: don't allow infinite values. If true: allowpublic Schema.Builder addColumnsDouble(String... columnNames)
columnNames
- Names of the columns to addpublic Schema.Builder addColumnInteger(String name)
name
- Name of the columnpublic Schema.Builder addColumnInteger(String name, Integer minAllowedValue, Integer maxAllowedValue)
name
- Name of the columnminAllowedValue
- Minimum allowed value (inclusive). If null: no restrictionmaxAllowedValue
- Maximum allowed value (inclusive). If null: no restrictionpublic Schema.Builder addColumnsInteger(String... names)
names
- Names of the integer columns to addpublic Schema.Builder addColumnCategorical(String name, String... stateNames)
name
- Name of the columnstateNames
- Names of the allowable states for this categorical columnpublic Schema.Builder addColumnCategorical(String name, List<String> stateNames)
name
- Name of the columnstateNames
- Names of the allowable states for this categorical columnpublic Schema.Builder addColumnLong(String name)
name
- Name of the columnpublic Schema.Builder addColumnLong(String name, Long minAllowedValue, Long maxAllowedValue)
name
- Name of the columnminAllowedValue
- Minimum allowed value (inclusive). If null: no restrictionmaxAllowedValue
- Maximum allowed value (inclusive). If null: no restrictionpublic Schema.Builder addColumnsLong(String... names)
names
- Names of the Long columns to addpublic Schema.Builder addColumn(String name, ColumnMetaData metaData)
name
- Name of the columnmetaData
- metadata for this columnpublic Schema.Builder addColumnString(String name)
name
- Name of the columnpublic Schema.Builder addColumnsString(String... columnNames)
columnNames
- Names of the String columns to addpublic Schema.Builder addColumnString(String name, String regex, Integer minAllowableLength, int maxAllowableLength)
name
- Name of the columnregex
- Regex that the String must match in order to be considered value. If null: no regex restrictionminAllowableLength
- Minimum allowable length for the String to be considered validmaxAllowableLength
- Maximum allowable length for the String to be considered validpublic Schema.Builder addColumnTime(String columnName, TimeZone timeZone)
columnName
- Name of the columntimeZone
- Time zone of the time columnpublic Schema.Builder addColumnTime(String columnName, org.joda.time.DateTimeZone timeZone)
columnName
- Name of the columntimeZone
- Time zone of the time columnpublic Schema.Builder addColumnTime(String columnName, org.joda.time.DateTimeZone timeZone, Long minValidValue, Long maxValidValue)
columnName
- Name of the columntimeZone
- Time zone of the time columnminValidValue
- Minumum allowable time (in milliseconds). May be null.maxValidValue
- Maximum allowable time (in milliseconds). May be null.public Schema build()
Copyright © 2016. All rights reserved.