
org.apache.gobblin.rest.Table Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gobblin-rest-api-data-template Show documentation
Show all versions of gobblin-rest-api-data-template Show documentation
A distributed data integration framework for streaming and batch data ecosystems.
The newest version!
package org.apache.gobblin.rest;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.linkedin.data.DataMap;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.schema.SchemaFormatType;
import com.linkedin.data.template.DataTemplateUtil;
import com.linkedin.data.template.GetMode;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.data.template.SetMode;
/**
* Gobblin table definition
*
*/
@Generated(value = "com.linkedin.pegasus.generator.JavaCodeUtil", comments = "Rest.li Data Template. Generated from gobblin-rest-service/gobblin-rest-api/src/main/pegasus/org/apache/gobblin/rest/Table.pdl.")
public class Table
extends RecordTemplate
{
private final static Table.Fields _fields = new Table.Fields();
private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("namespace org.apache.gobblin.rest/**Gobblin table definition*/record Table{/**Table namespace*/`namespace`:optional string/**Table name*/name:string/**Table type*/type:optional enum TableTypeEnum{SNAPSHOT_ONLY,SNAPSHOT_APPEND,APPEND_ONLY}}", SchemaFormatType.PDL));
private final static RecordDataSchema.Field FIELD_Namespace = SCHEMA.getField("namespace");
private final static RecordDataSchema.Field FIELD_Name = SCHEMA.getField("name");
private final static RecordDataSchema.Field FIELD_Type = SCHEMA.getField("type");
public Table() {
super(new DataMap(4, 0.75F), SCHEMA);
}
public Table(DataMap data) {
super(data, SCHEMA);
}
public static Table.Fields fields() {
return _fields;
}
/**
* Existence checker for namespace
*
* @see Table.Fields#namespace
*/
public boolean hasNamespace() {
return contains(FIELD_Namespace);
}
/**
* Remover for namespace
*
* @see Table.Fields#namespace
*/
public void removeNamespace() {
remove(FIELD_Namespace);
}
/**
* Getter for namespace
*
* @see Table.Fields#namespace
*/
public String getNamespace(GetMode mode) {
return obtainDirect(FIELD_Namespace, String.class, mode);
}
/**
* Getter for namespace
*
* @return
* Optional field. Always check for null.
* @see Table.Fields#namespace
*/
@Nullable
public String getNamespace() {
return obtainDirect(FIELD_Namespace, String.class, GetMode.STRICT);
}
/**
* Setter for namespace
*
* @see Table.Fields#namespace
*/
public Table setNamespace(String value, SetMode mode) {
putDirect(FIELD_Namespace, String.class, String.class, value, mode);
return this;
}
/**
* Setter for namespace
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see Table.Fields#namespace
*/
public Table setNamespace(
@Nonnull
String value) {
putDirect(FIELD_Namespace, String.class, String.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Existence checker for name
*
* @see Table.Fields#name
*/
public boolean hasName() {
return contains(FIELD_Name);
}
/**
* Remover for name
*
* @see Table.Fields#name
*/
public void removeName() {
remove(FIELD_Name);
}
/**
* Getter for name
*
* @see Table.Fields#name
*/
public String getName(GetMode mode) {
return obtainDirect(FIELD_Name, String.class, mode);
}
/**
* Getter for name
*
* @return
* Required field. Could be null for partial record.
* @see Table.Fields#name
*/
@Nonnull
public String getName() {
return obtainDirect(FIELD_Name, String.class, GetMode.STRICT);
}
/**
* Setter for name
*
* @see Table.Fields#name
*/
public Table setName(String value, SetMode mode) {
putDirect(FIELD_Name, String.class, String.class, value, mode);
return this;
}
/**
* Setter for name
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see Table.Fields#name
*/
public Table setName(
@Nonnull
String value) {
putDirect(FIELD_Name, String.class, String.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Existence checker for type
*
* @see Table.Fields#type
*/
public boolean hasType() {
return contains(FIELD_Type);
}
/**
* Remover for type
*
* @see Table.Fields#type
*/
public void removeType() {
remove(FIELD_Type);
}
/**
* Getter for type
*
* @see Table.Fields#type
*/
public TableTypeEnum getType(GetMode mode) {
return obtainDirect(FIELD_Type, TableTypeEnum.class, mode);
}
/**
* Getter for type
*
* @return
* Optional field. Always check for null.
* @see Table.Fields#type
*/
@Nullable
public TableTypeEnum getType() {
return obtainDirect(FIELD_Type, TableTypeEnum.class, GetMode.STRICT);
}
/**
* Setter for type
*
* @see Table.Fields#type
*/
public Table setType(TableTypeEnum value, SetMode mode) {
putDirect(FIELD_Type, TableTypeEnum.class, String.class, value, mode);
return this;
}
/**
* Setter for type
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see Table.Fields#type
*/
public Table setType(
@Nonnull
TableTypeEnum value) {
putDirect(FIELD_Type, TableTypeEnum.class, String.class, value, SetMode.DISALLOW_NULL);
return this;
}
@Override
public Table clone()
throws CloneNotSupportedException
{
return ((Table) super.clone());
}
@Override
public Table copy()
throws CloneNotSupportedException
{
return ((Table) super.copy());
}
public static class Fields
extends PathSpec
{
public Fields(List path, String name) {
super(path, name);
}
public Fields() {
super();
}
/**
* Table namespace
*
*/
public PathSpec namespace() {
return new PathSpec(getPathComponents(), "namespace");
}
/**
* Table name
*
*/
public PathSpec name() {
return new PathSpec(getPathComponents(), "name");
}
/**
* Table type
*
*/
public PathSpec type() {
return new PathSpec(getPathComponents(), "type");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy