odata.msgraph.client.entity.WorkbookRangeFont Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of odata-client-msgraph Show documentation
Show all versions of odata-client-msgraph Show documentation
Java client for use with the Microsoft Graph v1.0 endpoint
package odata.msgraph.client.entity;
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.ClientException;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.ODataEntityType;
import com.github.davidmoten.odata.client.RequestOptions;
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.RequestHelper;
import com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.Optional;
@JsonPropertyOrder({
"@odata.type",
"bold",
"color",
"italic",
"name",
"size",
"underline"})
@JsonInclude(Include.NON_NULL)
public class WorkbookRangeFont extends Entity implements ODataEntityType {
@Override
public String odataTypeName() {
return "microsoft.graph.workbookRangeFont";
}
@JsonProperty("bold")
protected Boolean bold;
@JsonProperty("color")
protected String color;
@JsonProperty("italic")
protected Boolean italic;
@JsonProperty("name")
protected String name;
@JsonProperty("size")
protected Double size;
@JsonProperty("underline")
protected String underline;
protected WorkbookRangeFont() {
super();
}
/**
* 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 builderWorkbookRangeFont() {
return new Builder();
}
public static final class Builder {
private String id;
private Boolean bold;
private String color;
private Boolean italic;
private String name;
private Double size;
private String underline;
private ChangedFields changedFields = ChangedFields.EMPTY;
Builder() {
// prevent instantiation
}
public Builder id(String id) {
this.id = id;
this.changedFields = changedFields.add("id");
return this;
}
public Builder bold(Boolean bold) {
this.bold = bold;
this.changedFields = changedFields.add("bold");
return this;
}
public Builder color(String color) {
this.color = color;
this.changedFields = changedFields.add("color");
return this;
}
public Builder italic(Boolean italic) {
this.italic = italic;
this.changedFields = changedFields.add("italic");
return this;
}
public Builder name(String name) {
this.name = name;
this.changedFields = changedFields.add("name");
return this;
}
public Builder size(Double size) {
this.size = size;
this.changedFields = changedFields.add("size");
return this;
}
public Builder underline(String underline) {
this.underline = underline;
this.changedFields = changedFields.add("underline");
return this;
}
public WorkbookRangeFont build() {
WorkbookRangeFont _x = new WorkbookRangeFont();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.workbookRangeFont";
_x.id = id;
_x.bold = bold;
_x.color = color;
_x.italic = italic;
_x.name = name;
_x.size = size;
_x.underline = underline;
return _x;
}
}
@Override
@JsonIgnore
public ChangedFields getChangedFields() {
return changedFields;
}
@Override
public void postInject(boolean addKeysToContextPath) {
if (addKeysToContextPath && id != null) {
contextPath = contextPath.clearQueries().addKeys(new NameValue(id, String.class));
}
}
@Property(name="bold")
@JsonIgnore
public Optional getBold() {
return Optional.ofNullable(bold);
}
public WorkbookRangeFont withBold(Boolean bold) {
WorkbookRangeFont _x = _copy();
_x.changedFields = changedFields.add("bold");
_x.odataType = Util.nvl(odataType, "microsoft.graph.workbookRangeFont");
_x.bold = bold;
return _x;
}
@Property(name="color")
@JsonIgnore
public Optional getColor() {
return Optional.ofNullable(color);
}
public WorkbookRangeFont withColor(String color) {
WorkbookRangeFont _x = _copy();
_x.changedFields = changedFields.add("color");
_x.odataType = Util.nvl(odataType, "microsoft.graph.workbookRangeFont");
_x.color = color;
return _x;
}
@Property(name="italic")
@JsonIgnore
public Optional getItalic() {
return Optional.ofNullable(italic);
}
public WorkbookRangeFont withItalic(Boolean italic) {
WorkbookRangeFont _x = _copy();
_x.changedFields = changedFields.add("italic");
_x.odataType = Util.nvl(odataType, "microsoft.graph.workbookRangeFont");
_x.italic = italic;
return _x;
}
@Property(name="name")
@JsonIgnore
public Optional getName() {
return Optional.ofNullable(name);
}
public WorkbookRangeFont withName(String name) {
WorkbookRangeFont _x = _copy();
_x.changedFields = changedFields.add("name");
_x.odataType = Util.nvl(odataType, "microsoft.graph.workbookRangeFont");
_x.name = name;
return _x;
}
@Property(name="size")
@JsonIgnore
public Optional getSize() {
return Optional.ofNullable(size);
}
public WorkbookRangeFont withSize(Double size) {
WorkbookRangeFont _x = _copy();
_x.changedFields = changedFields.add("size");
_x.odataType = Util.nvl(odataType, "microsoft.graph.workbookRangeFont");
_x.size = size;
return _x;
}
@Property(name="underline")
@JsonIgnore
public Optional getUnderline() {
return Optional.ofNullable(underline);
}
public WorkbookRangeFont withUnderline(String underline) {
WorkbookRangeFont _x = _copy();
_x.changedFields = changedFields.add("underline");
_x.odataType = Util.nvl(odataType, "microsoft.graph.workbookRangeFont");
_x.underline = underline;
return _x;
}
public WorkbookRangeFont withUnmappedField(String name, Object value) {
WorkbookRangeFont _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();
}
/**
* Submits only changed fields for update and returns an
* immutable copy of {@code this} with changed fields reset.
*
* @return a copy of {@code this} with changed fields reset
* @throws ClientException if HTTP response is not as expected
*/
public WorkbookRangeFont patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
WorkbookRangeFont _x = _copy();
_x.changedFields = null;
return _x;
}
/**
* Submits all fields for update and returns an immutable copy of {@code this}
* with changed fields reset (they were ignored anyway).
*
* @return a copy of {@code this} with changed fields reset
* @throws ClientException if HTTP response is not as expected
*/
public WorkbookRangeFont put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
WorkbookRangeFont _x = _copy();
_x.changedFields = null;
return _x;
}
private WorkbookRangeFont _copy() {
WorkbookRangeFont _x = new WorkbookRangeFont();
_x.contextPath = contextPath;
_x.changedFields = changedFields;
_x.unmappedFields = unmappedFields.copy();
_x.odataType = odataType;
_x.id = id;
_x.bold = bold;
_x.color = color;
_x.italic = italic;
_x.name = name;
_x.size = size;
_x.underline = underline;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("WorkbookRangeFont[");
b.append("id=");
b.append(this.id);
b.append(", ");
b.append("bold=");
b.append(this.bold);
b.append(", ");
b.append("color=");
b.append(this.color);
b.append(", ");
b.append("italic=");
b.append(this.italic);
b.append(", ");
b.append("name=");
b.append(this.name);
b.append(", ");
b.append("size=");
b.append(this.size);
b.append(", ");
b.append("underline=");
b.append(this.underline);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy