All Downloads are FREE. Search and download functionalities are using the official Maven repository.

odata.msgraph.client.beta.complex.PhysicalAddress Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package odata.msgraph.client.beta.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.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.Optional;

import odata.msgraph.client.beta.enums.PhysicalAddressType;

@JsonPropertyOrder({
    "@odata.type", 
    "city", 
    "countryOrRegion", 
    "postalCode", 
    "postOfficeBox", 
    "state", 
    "street", 
    "type"})
@JsonInclude(Include.NON_NULL)
public class PhysicalAddress implements ODataType {

    @JacksonInject
    @JsonIgnore
    protected ContextPath contextPath;

    @JacksonInject
    @JsonIgnore
    protected UnmappedFieldsImpl unmappedFields;

    @JsonProperty("@odata.type")
    protected String odataType;

    @JsonProperty("city")
    protected String city;

    @JsonProperty("countryOrRegion")
    protected String countryOrRegion;

    @JsonProperty("postalCode")
    protected String postalCode;

    @JsonProperty("postOfficeBox")
    protected String postOfficeBox;

    @JsonProperty("state")
    protected String state;

    @JsonProperty("street")
    protected String street;

    @JsonProperty("type")
    protected PhysicalAddressType type;

    protected PhysicalAddress() {
    }

    @Override
    public String odataTypeName() {
        return "microsoft.graph.physicalAddress";
    }

    @Property(name="city")
    @JsonIgnore
    public Optional getCity() {
        return Optional.ofNullable(city);
    }

    public PhysicalAddress withCity(String city) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.city = city;
        return _x;
    }

    @Property(name="countryOrRegion")
    @JsonIgnore
    public Optional getCountryOrRegion() {
        return Optional.ofNullable(countryOrRegion);
    }

    public PhysicalAddress withCountryOrRegion(String countryOrRegion) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.countryOrRegion = countryOrRegion;
        return _x;
    }

    @Property(name="postalCode")
    @JsonIgnore
    public Optional getPostalCode() {
        return Optional.ofNullable(postalCode);
    }

    public PhysicalAddress withPostalCode(String postalCode) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.postalCode = postalCode;
        return _x;
    }

    @Property(name="postOfficeBox")
    @JsonIgnore
    public Optional getPostOfficeBox() {
        return Optional.ofNullable(postOfficeBox);
    }

    public PhysicalAddress withPostOfficeBox(String postOfficeBox) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.postOfficeBox = postOfficeBox;
        return _x;
    }

    @Property(name="state")
    @JsonIgnore
    public Optional getState() {
        return Optional.ofNullable(state);
    }

    public PhysicalAddress withState(String state) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.state = state;
        return _x;
    }

    @Property(name="street")
    @JsonIgnore
    public Optional getStreet() {
        return Optional.ofNullable(street);
    }

    public PhysicalAddress withStreet(String street) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.street = street;
        return _x;
    }

    @Property(name="type")
    @JsonIgnore
    public Optional getType() {
        return Optional.ofNullable(type);
    }

    public PhysicalAddress withType(PhysicalAddressType type) {
        PhysicalAddress _x = _copy();
        _x.odataType = Util.nvl(odataType, "microsoft.graph.physicalAddress");
        _x.type = type;
        return _x;
    }

    public PhysicalAddress withUnmappedField(String name, String value) {
        PhysicalAddress _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 String city;
        private String countryOrRegion;
        private String postalCode;
        private String postOfficeBox;
        private String state;
        private String street;
        private PhysicalAddressType type;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

        public Builder city(String city) {
            this.city = city;
            this.changedFields = changedFields.add("city");
            return this;
        }

        public Builder countryOrRegion(String countryOrRegion) {
            this.countryOrRegion = countryOrRegion;
            this.changedFields = changedFields.add("countryOrRegion");
            return this;
        }

        public Builder postalCode(String postalCode) {
            this.postalCode = postalCode;
            this.changedFields = changedFields.add("postalCode");
            return this;
        }

        public Builder postOfficeBox(String postOfficeBox) {
            this.postOfficeBox = postOfficeBox;
            this.changedFields = changedFields.add("postOfficeBox");
            return this;
        }

        public Builder state(String state) {
            this.state = state;
            this.changedFields = changedFields.add("state");
            return this;
        }

        public Builder street(String street) {
            this.street = street;
            this.changedFields = changedFields.add("street");
            return this;
        }

        public Builder type(PhysicalAddressType type) {
            this.type = type;
            this.changedFields = changedFields.add("type");
            return this;
        }

        public PhysicalAddress build() {
            PhysicalAddress _x = new PhysicalAddress();
            _x.contextPath = null;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.physicalAddress";
            _x.city = city;
            _x.countryOrRegion = countryOrRegion;
            _x.postalCode = postalCode;
            _x.postOfficeBox = postOfficeBox;
            _x.state = state;
            _x.street = street;
            _x.type = type;
            return _x;
        }
    }

    private PhysicalAddress _copy() {
        PhysicalAddress _x = new PhysicalAddress();
        _x.contextPath = contextPath;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.city = city;
        _x.countryOrRegion = countryOrRegion;
        _x.postalCode = postalCode;
        _x.postOfficeBox = postOfficeBox;
        _x.state = state;
        _x.street = street;
        _x.type = type;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("PhysicalAddress[");
        b.append("city=");
        b.append(this.city);
        b.append(", ");
        b.append("countryOrRegion=");
        b.append(this.countryOrRegion);
        b.append(", ");
        b.append("postalCode=");
        b.append(this.postalCode);
        b.append(", ");
        b.append("postOfficeBox=");
        b.append(this.postOfficeBox);
        b.append(", ");
        b.append("state=");
        b.append(this.state);
        b.append(", ");
        b.append("street=");
        b.append(this.street);
        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 - 2024 Weber Informatics LLC | Privacy Policy