com.heliorm.impl.TableBuilder Maven / Gradle / Ivy
The newest version!
package com.heliorm.impl;
import com.heliorm.Field;
import com.heliorm.Field.FieldType;
import com.heliorm.Table;
import java.time.Instant;
import java.util.Date;
public final class TableBuilder, O> {
private final T table;
private TableBuilder(T table) {
this.table = table;
}
public static , O> TableBuilder create(T table) {
return new TableBuilder<>(table);
}
public FieldBuilder> byteField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.BYTE, Byte.class, javaName);
}
public FieldBuilder> shortField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.SHORT, Short.class, javaName);
}
public FieldBuilder> integerField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.INTEGER, Integer.class, javaName);
}
public FieldBuilder> longField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.LONG, Long.class, javaName);
}
public FieldBuilder> floatField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.FLOAT, Float.class, javaName);
}
public FieldBuilder> doubleField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.DOUBLE, Double.class, javaName);
}
public FieldBuilder> dateField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.DATE, Date.class, javaName);
}
public FieldBuilder> instantField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.INSTANT, Instant.class, javaName);
}
public FieldBuilder> localDateTimeField(String javaName) {
return new FieldBuilder<>(table, FieldType.LOCAL_DATE_TIME, Instant.class, javaName);
}
public FieldBuilder> stringField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.STRING, String.class, javaName);
}
public FieldBuilder> booleanField(String javaName) {
return new FieldBuilder<>(table, Field.FieldType.BOOLEAN, Boolean.class, javaName);
}
public > FieldBuilder> enumField(String javaName, Class enumType) {
return new FieldBuilder<>(table, Field.FieldType.ENUM, enumType, javaName);
}
public FieldBuilder> byteArrayField(String javaName) {
return new FieldBuilder<>(table, FieldType.BYTE_ARRAY, byte[].class, javaName);
}
}