// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.maps.route.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.models.GeoPosition;
import com.azure.maps.route.implementation.models.LatLongPair;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.stream.Collectors;

/** Reachable Range. */
@Fluent
public final class RouteRange {
    /*
     * Center point of the reachable range
     */
    @JsonProperty(value = "center")
    private LatLongPair center;

    /*
     * Polygon boundary of the reachable range represented as a list of points.
     */
    @JsonProperty(value = "boundary", access = JsonProperty.Access.WRITE_ONLY)
    private List<LatLongPair> boundary;

    /**
     * Get the center property: Center point of the reachable range.
     *
     * @return the center value.
     */
    public GeoPosition getCenter() {
        LatLongPair returnValue = this.center;
        return new GeoPosition(returnValue.getLongitude(), returnValue.getLatitude());
    }

    /**
     * Returns a list of {@link GeoPosition} coordinates.
     *
     * @return a list of {@code GeoPosition} representing the boundary.
     */
    public List<GeoPosition> getBoundary() {
        return this.boundary.stream()
                .map(item -> new GeoPosition(item.getLongitude(), item.getLatitude()))
                .collect(Collectors.toList());
    }
}
