MatrixRequestOptions.java

  1. /*
  2.  * This file is part of Openrouteservice.
  3.  *
  4.  * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the
  5.  * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1
  6.  * of the License, or (at your option) any later version.
  7.  *
  8.  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  9.  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10.  * See the GNU Lesser General Public License for more details.
  11.  *
  12.  * You should have received a copy of the GNU Lesser General Public License along with this library;
  13.  * if not, see <https://www.gnu.org/licenses/>.
  14.  */

  15. package org.heigit.ors.api.requests.matrix;

  16. import com.fasterxml.jackson.annotation.JsonIgnore;
  17. import com.fasterxml.jackson.annotation.JsonInclude;
  18. import com.fasterxml.jackson.annotation.JsonProperty;
  19. import io.swagger.v3.oas.annotations.media.Schema;
  20. import org.heigit.ors.api.requests.common.RequestOptions;

  21. @Schema(name = "Matrix Options", description = "Advanced options for matrix", subTypes = {MatrixRequest.class})
  22. @JsonInclude(JsonInclude.Include.NON_DEFAULT)
  23. public class MatrixRequestOptions extends RequestOptions {
  24.     public static final String PARAM_DYNAMIC_SPEEDS = "dynamic_speeds";

  25.     @Schema(name = PARAM_DYNAMIC_SPEEDS, description = "Option to use dynamic speed updates on some pre-defined speeds.",
  26.             example = "{true}")
  27.     @JsonProperty(PARAM_DYNAMIC_SPEEDS)
  28.     private boolean dynamicSpeeds;
  29.     @JsonIgnore
  30.     private boolean hasDynamicSpeeds = false;


  31.     public boolean getDynamicSpeeds() {
  32.         return dynamicSpeeds;
  33.     }

  34.     public void setDynamicSpeeds(boolean dynamicSpeeds) {
  35.         this.dynamicSpeeds = dynamicSpeeds;
  36.         hasDynamicSpeeds = true;
  37.     }

  38.     public boolean hasDynamicSpeeds() {
  39.         return hasDynamicSpeeds;
  40.     }

  41. }