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

com.github.marcoshsc.orsApiTools.isochrones.helperclasses.Info Maven / Gradle / Ivy

There is a newer version: 2.2.2
Show newest version
package com.github.marcoshsc.orsApiTools.isochrones.helperclasses;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.github.marcoshsc.orsApiTools.isochrones.enums.EnumAttributes;
import com.github.marcoshsc.orsApiTools.isochrones.enums.EnumRangeType;
import com.github.marcoshsc.orsApiTools.json.deserializers.CoordinateListDeserializer;
import lombok.Getter;
import lombok.ToString;
import org.locationtech.jts.geom.Coordinate;

import java.util.ArrayList;
import java.util.List;

@Getter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class Info {

    private final List range;

    @JsonDeserialize(using = CoordinateListDeserializer.class)
    private final List locations;

    private final EnumRangeType rangeType;
    private final List attributes;

    @JsonCreator
    public Info(@JsonProperty(value = "range", required = true) List range,
                @JsonProperty(value = "locations", required = true) List locations,
                @JsonProperty(value = "range_type") EnumRangeType rangeType,
                @JsonProperty("attributes") List attributes) {
        this.range = range;
        this.locations = locations;
        this.rangeType = rangeType == null ? EnumRangeType.TIME : rangeType;
        this.attributes = attributes == null ? new ArrayList<>() : attributes;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy