
odata.msgraph.client.complex.RecurrenceRange Maven / Gradle / Ivy
package odata.msgraph.client.complex;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
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.ContextPath;
import com.github.davidmoten.odata.client.ODataType;
import com.github.davidmoten.odata.client.UnmappedFields;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.time.LocalDate;
import java.util.Optional;
import odata.msgraph.client.enums.RecurrenceRangeType;
@JsonPropertyOrder({
"@odata.type",
"endDate",
"numberOfOccurrences",
"recurrenceTimeZone",
"startDate",
"type"})
@JsonInclude(Include.NON_NULL)
public class RecurrenceRange implements ODataType {
@JacksonInject
@JsonIgnore
protected ContextPath contextPath;
@JacksonInject
@JsonIgnore
protected UnmappedFieldsImpl unmappedFields;
@JsonProperty("@odata.type")
protected String odataType;
@JsonProperty("endDate")
protected LocalDate endDate;
@JsonProperty("numberOfOccurrences")
protected Integer numberOfOccurrences;
@JsonProperty("recurrenceTimeZone")
protected String recurrenceTimeZone;
@JsonProperty("startDate")
protected LocalDate startDate;
@JsonProperty("type")
protected RecurrenceRangeType type;
protected RecurrenceRange() {
}
@Override
public String odataTypeName() {
return "microsoft.graph.recurrenceRange";
}
@Property(name="endDate")
@JsonIgnore
public Optional getEndDate() {
return Optional.ofNullable(endDate);
}
public RecurrenceRange withEndDate(LocalDate endDate) {
RecurrenceRange _x = _copy();
_x.odataType = Util.nvl(odataType, "microsoft.graph.recurrenceRange");
_x.endDate = endDate;
return _x;
}
@Property(name="numberOfOccurrences")
@JsonIgnore
public Optional getNumberOfOccurrences() {
return Optional.ofNullable(numberOfOccurrences);
}
public RecurrenceRange withNumberOfOccurrences(Integer numberOfOccurrences) {
RecurrenceRange _x = _copy();
_x.odataType = Util.nvl(odataType, "microsoft.graph.recurrenceRange");
_x.numberOfOccurrences = numberOfOccurrences;
return _x;
}
@Property(name="recurrenceTimeZone")
@JsonIgnore
public Optional getRecurrenceTimeZone() {
return Optional.ofNullable(recurrenceTimeZone);
}
public RecurrenceRange withRecurrenceTimeZone(String recurrenceTimeZone) {
RecurrenceRange _x = _copy();
_x.odataType = Util.nvl(odataType, "microsoft.graph.recurrenceRange");
_x.recurrenceTimeZone = recurrenceTimeZone;
return _x;
}
@Property(name="startDate")
@JsonIgnore
public Optional getStartDate() {
return Optional.ofNullable(startDate);
}
public RecurrenceRange withStartDate(LocalDate startDate) {
RecurrenceRange _x = _copy();
_x.odataType = Util.nvl(odataType, "microsoft.graph.recurrenceRange");
_x.startDate = startDate;
return _x;
}
@Property(name="type")
@JsonIgnore
public Optional getType() {
return Optional.ofNullable(type);
}
public RecurrenceRange withType(RecurrenceRangeType type) {
RecurrenceRange _x = _copy();
_x.odataType = Util.nvl(odataType, "microsoft.graph.recurrenceRange");
_x.type = type;
return _x;
}
public RecurrenceRange withUnmappedField(String name, String value) {
RecurrenceRange _x = _copy();
_x.setUnmappedField(name, value);
return _x;
}
@JsonAnySetter
private void setUnmappedField(String name, Object value) {
if (unmappedFields == null) {
unmappedFields = new UnmappedFieldsImpl();
}
unmappedFields.put(name, value);
}
@JsonAnyGetter
private UnmappedFieldsImpl unmappedFields() {
return unmappedFields == null ? UnmappedFieldsImpl.EMPTY : unmappedFields;
}
@Override
public UnmappedFields getUnmappedFields() {
return unmappedFields();
}
@Override
public void postInject(boolean addKeysToContextPath) {
// do nothing;
}
/**
* Returns a builder which is used to create a new
* instance of this class (given that this class is immutable).
*
* @return a new Builder for this class
*/
// Suffix used on builder factory method to differentiate the method
// from static builder methods on superclasses
public static Builder builder() {
return new Builder();
}
public static final class Builder {
private LocalDate endDate;
private Integer numberOfOccurrences;
private String recurrenceTimeZone;
private LocalDate startDate;
private RecurrenceRangeType type;
private ChangedFields changedFields = ChangedFields.EMPTY;
Builder() {
// prevent instantiation
}
public Builder endDate(LocalDate endDate) {
this.endDate = endDate;
this.changedFields = changedFields.add("endDate");
return this;
}
public Builder numberOfOccurrences(Integer numberOfOccurrences) {
this.numberOfOccurrences = numberOfOccurrences;
this.changedFields = changedFields.add("numberOfOccurrences");
return this;
}
public Builder recurrenceTimeZone(String recurrenceTimeZone) {
this.recurrenceTimeZone = recurrenceTimeZone;
this.changedFields = changedFields.add("recurrenceTimeZone");
return this;
}
public Builder startDate(LocalDate startDate) {
this.startDate = startDate;
this.changedFields = changedFields.add("startDate");
return this;
}
public Builder type(RecurrenceRangeType type) {
this.type = type;
this.changedFields = changedFields.add("type");
return this;
}
public RecurrenceRange build() {
RecurrenceRange _x = new RecurrenceRange();
_x.contextPath = null;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.recurrenceRange";
_x.endDate = endDate;
_x.numberOfOccurrences = numberOfOccurrences;
_x.recurrenceTimeZone = recurrenceTimeZone;
_x.startDate = startDate;
_x.type = type;
return _x;
}
}
private RecurrenceRange _copy() {
RecurrenceRange _x = new RecurrenceRange();
_x.contextPath = contextPath;
_x.unmappedFields = unmappedFields.copy();
_x.odataType = odataType;
_x.endDate = endDate;
_x.numberOfOccurrences = numberOfOccurrences;
_x.recurrenceTimeZone = recurrenceTimeZone;
_x.startDate = startDate;
_x.type = type;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("RecurrenceRange[");
b.append("endDate=");
b.append(this.endDate);
b.append(", ");
b.append("numberOfOccurrences=");
b.append(this.numberOfOccurrences);
b.append(", ");
b.append("recurrenceTimeZone=");
b.append(this.recurrenceTimeZone);
b.append(", ");
b.append("startDate=");
b.append(this.startDate);
b.append(", ");
b.append("type=");
b.append(this.type);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy