
org.apache.gobblin.rest.TimeRange 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;
/**
* Query time range
*
*/
@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/TimeRange.pdl.")
public class TimeRange
extends RecordTemplate
{
private final static TimeRange.Fields _fields = new TimeRange.Fields();
private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("namespace org.apache.gobblin.rest/**Query time range*/record TimeRange{/**Start time of the query range*/startTime:optional string/**End time of the query range*/endTime:optional string/**Date/time format used to parse the start time and end time*/timeFormat:string}", SchemaFormatType.PDL));
private final static RecordDataSchema.Field FIELD_StartTime = SCHEMA.getField("startTime");
private final static RecordDataSchema.Field FIELD_EndTime = SCHEMA.getField("endTime");
private final static RecordDataSchema.Field FIELD_TimeFormat = SCHEMA.getField("timeFormat");
public TimeRange() {
super(new DataMap(4, 0.75F), SCHEMA);
}
public TimeRange(DataMap data) {
super(data, SCHEMA);
}
public static TimeRange.Fields fields() {
return _fields;
}
/**
* Existence checker for startTime
*
* @see TimeRange.Fields#startTime
*/
public boolean hasStartTime() {
return contains(FIELD_StartTime);
}
/**
* Remover for startTime
*
* @see TimeRange.Fields#startTime
*/
public void removeStartTime() {
remove(FIELD_StartTime);
}
/**
* Getter for startTime
*
* @see TimeRange.Fields#startTime
*/
public String getStartTime(GetMode mode) {
return obtainDirect(FIELD_StartTime, String.class, mode);
}
/**
* Getter for startTime
*
* @return
* Optional field. Always check for null.
* @see TimeRange.Fields#startTime
*/
@Nullable
public String getStartTime() {
return obtainDirect(FIELD_StartTime, String.class, GetMode.STRICT);
}
/**
* Setter for startTime
*
* @see TimeRange.Fields#startTime
*/
public TimeRange setStartTime(String value, SetMode mode) {
putDirect(FIELD_StartTime, String.class, String.class, value, mode);
return this;
}
/**
* Setter for startTime
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see TimeRange.Fields#startTime
*/
public TimeRange setStartTime(
@Nonnull
String value) {
putDirect(FIELD_StartTime, String.class, String.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Existence checker for endTime
*
* @see TimeRange.Fields#endTime
*/
public boolean hasEndTime() {
return contains(FIELD_EndTime);
}
/**
* Remover for endTime
*
* @see TimeRange.Fields#endTime
*/
public void removeEndTime() {
remove(FIELD_EndTime);
}
/**
* Getter for endTime
*
* @see TimeRange.Fields#endTime
*/
public String getEndTime(GetMode mode) {
return obtainDirect(FIELD_EndTime, String.class, mode);
}
/**
* Getter for endTime
*
* @return
* Optional field. Always check for null.
* @see TimeRange.Fields#endTime
*/
@Nullable
public String getEndTime() {
return obtainDirect(FIELD_EndTime, String.class, GetMode.STRICT);
}
/**
* Setter for endTime
*
* @see TimeRange.Fields#endTime
*/
public TimeRange setEndTime(String value, SetMode mode) {
putDirect(FIELD_EndTime, String.class, String.class, value, mode);
return this;
}
/**
* Setter for endTime
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see TimeRange.Fields#endTime
*/
public TimeRange setEndTime(
@Nonnull
String value) {
putDirect(FIELD_EndTime, String.class, String.class, value, SetMode.DISALLOW_NULL);
return this;
}
/**
* Existence checker for timeFormat
*
* @see TimeRange.Fields#timeFormat
*/
public boolean hasTimeFormat() {
return contains(FIELD_TimeFormat);
}
/**
* Remover for timeFormat
*
* @see TimeRange.Fields#timeFormat
*/
public void removeTimeFormat() {
remove(FIELD_TimeFormat);
}
/**
* Getter for timeFormat
*
* @see TimeRange.Fields#timeFormat
*/
public String getTimeFormat(GetMode mode) {
return obtainDirect(FIELD_TimeFormat, String.class, mode);
}
/**
* Getter for timeFormat
*
* @return
* Required field. Could be null for partial record.
* @see TimeRange.Fields#timeFormat
*/
@Nonnull
public String getTimeFormat() {
return obtainDirect(FIELD_TimeFormat, String.class, GetMode.STRICT);
}
/**
* Setter for timeFormat
*
* @see TimeRange.Fields#timeFormat
*/
public TimeRange setTimeFormat(String value, SetMode mode) {
putDirect(FIELD_TimeFormat, String.class, String.class, value, mode);
return this;
}
/**
* Setter for timeFormat
*
* @param value
* Must not be null. For more control, use setters with mode instead.
* @see TimeRange.Fields#timeFormat
*/
public TimeRange setTimeFormat(
@Nonnull
String value) {
putDirect(FIELD_TimeFormat, String.class, String.class, value, SetMode.DISALLOW_NULL);
return this;
}
@Override
public TimeRange clone()
throws CloneNotSupportedException
{
return ((TimeRange) super.clone());
}
@Override
public TimeRange copy()
throws CloneNotSupportedException
{
return ((TimeRange) super.copy());
}
public static class Fields
extends PathSpec
{
public Fields(List path, String name) {
super(path, name);
}
public Fields() {
super();
}
/**
* Start time of the query range
*
*/
public PathSpec startTime() {
return new PathSpec(getPathComponents(), "startTime");
}
/**
* End time of the query range
*
*/
public PathSpec endTime() {
return new PathSpec(getPathComponents(), "endTime");
}
/**
* Date/time format used to parse the start time and end time
*
*/
public PathSpec timeFormat() {
return new PathSpec(getPathComponents(), "timeFormat");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy