odata.test.trip.pin.entity.PublicTransportation Maven / Gradle / Ivy
package odata.test.trip.pin.entity;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.github.davidmoten.odata.client.ODataEntityType;
import com.github.davidmoten.odata.client.RequestOptions;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.RequestHelper;
import com.github.davidmoten.odata.client.internal.UnmappedFields;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Optional;
import odata.test.trip.pin.entity.PlanItem;
import odata.test.trip.pin.schema.SchemaInfo;
@JsonInclude(Include.NON_NULL)
@JsonPropertyOrder({
"@odata.type",
"SeatNumber"})
public class PublicTransportation extends PlanItem implements ODataEntityType {
@JsonProperty("SeatNumber")
protected String seatNumber;
protected PublicTransportation() {
super();
}
public static Builder builderPublicTransportation() {
return new Builder();
}
public static final class Builder {
private Integer planItemId;
private String confirmationCode;
private OffsetDateTime startsAt;
private OffsetDateTime endsAt;
private Duration duration;
private String seatNumber;
private ChangedFields changedFields = ChangedFields.EMPTY;
Builder() {
// prevent instantiation
}
public Builder planItemId(Integer planItemId) {
this.planItemId = planItemId;
this.changedFields = changedFields.add("PlanItemId");
return this;
}
public Builder confirmationCode(String confirmationCode) {
this.confirmationCode = confirmationCode;
this.changedFields = changedFields.add("ConfirmationCode");
return this;
}
public Builder startsAt(OffsetDateTime startsAt) {
this.startsAt = startsAt;
this.changedFields = changedFields.add("StartsAt");
return this;
}
public Builder endsAt(OffsetDateTime endsAt) {
this.endsAt = endsAt;
this.changedFields = changedFields.add("EndsAt");
return this;
}
public Builder duration(Duration duration) {
this.duration = duration;
this.changedFields = changedFields.add("Duration");
return this;
}
public Builder seatNumber(String seatNumber) {
this.seatNumber = seatNumber;
this.changedFields = changedFields.add("SeatNumber");
return this;
}
public PublicTransportation build() {
PublicTransportation _x = new PublicTransportation();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = UnmappedFields.EMPTY;
_x.odataType = "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation";
_x.planItemId = planItemId;
_x.confirmationCode = confirmationCode;
_x.startsAt = startsAt;
_x.endsAt = endsAt;
_x.duration = duration;
_x.seatNumber = seatNumber;
return _x;
}
}
public ChangedFields getChangedFields() {
return changedFields;
}
public Optional getSeatNumber() {
return Optional.ofNullable(seatNumber);
}
public PublicTransportation withSeatNumber(String seatNumber) {
PublicTransportation _x = _copy();
_x.changedFields = changedFields.add("SeatNumber");
_x.odataType = Util.nvl(odataType, "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation");
_x.seatNumber = seatNumber;
return _x;
}
@JsonAnySetter
private void setUnmappedField(String name, Object value) {
if (unmappedFields == null) {
unmappedFields = new UnmappedFields();
}
unmappedFields.put(name, value);
}
@Override
public UnmappedFields getUnmappedFields() {
return unmappedFields == null ? UnmappedFields.EMPTY : unmappedFields;
}
public PublicTransportation patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY, SchemaInfo.INSTANCE);
PublicTransportation _x = _copy();
_x.changedFields = null;
return _x;
}
public PublicTransportation put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY, SchemaInfo.INSTANCE);
PublicTransportation _x = _copy();
_x.changedFields = null;
return _x;
}
private PublicTransportation _copy() {
PublicTransportation _x = new PublicTransportation();
_x.contextPath = contextPath;
_x.changedFields = changedFields;
_x.unmappedFields = unmappedFields;
_x.odataType = odataType;
_x.planItemId = planItemId;
_x.confirmationCode = confirmationCode;
_x.startsAt = startsAt;
_x.endsAt = endsAt;
_x.duration = duration;
_x.seatNumber = seatNumber;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("PublicTransportation[");
b.append("PlanItemId=");
b.append(this.planItemId);
b.append(", ");
b.append("ConfirmationCode=");
b.append(this.confirmationCode);
b.append(", ");
b.append("StartsAt=");
b.append(this.startsAt);
b.append(", ");
b.append("EndsAt=");
b.append(this.endsAt);
b.append(", ");
b.append("Duration=");
b.append(this.duration);
b.append(", ");
b.append("SeatNumber=");
b.append(this.seatNumber);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy