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

odata.test.trip.pin.complex.AirportLocation 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.edm.GeographyPoint;
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", 
    "Loc"})
public class AirportLocation extends Location implements ODataType {


    @JacksonInject
    @JsonIgnore
    protected UnmappedFields unmappedFields;

    @JsonProperty("Loc")
    protected GeographyPoint loc;

    protected AirportLocation() {
        super();
    }

    public Optional getLoc() {
        return Optional.ofNullable(loc);
    }

    public AirportLocation withLoc(GeographyPoint loc) {
        AirportLocation _x = _copy();
        _x.odataType = Util.nvl(odataType, "Microsoft.OData.SampleService.Models.TripPin.AirportLocation");
        _x.loc = loc;
        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 builderAirportLocation() {
        return new Builder();
    }

    public static final class Builder {
        private String address;
        private City city;
        private GeographyPoint loc;
        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 loc(GeographyPoint loc) {
            this.loc = loc;
            this.changedFields = changedFields.add("Loc");
            return this;
        }

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

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy