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

odata.test.trip.pin.complex.EventLocation Maven / Gradle / Ivy

There is a newer version: 0.1.13
Show newest version
package odata.test.trip.pin.complex;

import com.fasterxml.jackson.annotation.JacksonInject;
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.ODataType;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.UnmappedFields;
import java.util.Optional;
import odata.test.trip.pin.complex.City;
import odata.test.trip.pin.complex.Location;

@JsonInclude(Include.NON_NULL)
@JsonPropertyOrder({
    "@odata.type", 
    "BuildingInfo"})
public class EventLocation extends Location implements ODataType {


    @JacksonInject
    @JsonIgnore
    protected UnmappedFields unmappedFields;

    @JsonProperty("BuildingInfo")
    protected String buildingInfo;

    protected EventLocation() {
        super();
    }

    public Optional getBuildingInfo() {
        return Optional.ofNullable(buildingInfo);
    }

    public EventLocation withBuildingInfo(String buildingInfo) {
        EventLocation _x = _copy();
        _x.odataType = Util.nvl(odataType, "Microsoft.OData.SampleService.Models.TripPin.EventLocation");
        _x.buildingInfo = buildingInfo;
        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 static Builder builderEventLocation() {
        return new Builder();
    }

    public static final class Builder {
        private String address;
        private City city;
        private String buildingInfo;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

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

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

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

        public EventLocation build() {
            EventLocation _x = new EventLocation();
            _x.contextPath = null;
            _x.unmappedFields = UnmappedFields.EMPTY;
            _x.odataType = "Microsoft.OData.SampleService.Models.TripPin.EventLocation";
            _x.address = address;
            _x.city = city;
            _x.buildingInfo = buildingInfo;
            return _x;
        }
    }
    private EventLocation _copy() {
        EventLocation _x = new EventLocation();
        _x.contextPath = contextPath;
        _x.unmappedFields = unmappedFields;
        _x.odataType = odataType;
        _x.address = address;
        _x.city = city;
        _x.buildingInfo = buildingInfo;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("EventLocation[");
        b.append("Address=");
        b.append(this.address);
        b.append(", ");
        b.append("City=");
        b.append(this.city);
        b.append(", ");
        b.append("BuildingInfo=");
        b.append(this.buildingInfo);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy