Record Class TravelRestrictions

java.lang.Object
java.lang.Record
slash.navigation.routing.TravelRestrictions

public record TravelRestrictions(boolean avoidBridges, boolean avoidFerries, boolean avoidMotorways, boolean avoidTolls, boolean avoidTunnels) extends Record
Travel restrictions for a routing service.
Author:
Christian Pesch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TravelRestrictions
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TravelRestrictions(boolean avoidBridges, boolean avoidFerries, boolean avoidMotorways, boolean avoidTolls, boolean avoidTunnels)
    Creates an instance of a TravelRestrictions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the avoidBridges record component.
    boolean
    Returns the value of the avoidFerries record component.
    boolean
    Returns the value of the avoidMotorways record component.
    boolean
    Returns the value of the avoidTolls record component.
    boolean
    Returns the value of the avoidTunnels record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • TravelRestrictions

      public TravelRestrictions(boolean avoidBridges, boolean avoidFerries, boolean avoidMotorways, boolean avoidTolls, boolean avoidTunnels)
      Creates an instance of a TravelRestrictions record class.
      Parameters:
      avoidBridges - the value for the avoidBridges record component
      avoidFerries - the value for the avoidFerries record component
      avoidMotorways - the value for the avoidMotorways record component
      avoidTolls - the value for the avoidTolls record component
      avoidTunnels - the value for the avoidTunnels record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • avoidBridges

      public boolean avoidBridges()
      Returns the value of the avoidBridges record component.
      Returns:
      the value of the avoidBridges record component
    • avoidFerries

      public boolean avoidFerries()
      Returns the value of the avoidFerries record component.
      Returns:
      the value of the avoidFerries record component
    • avoidMotorways

      public boolean avoidMotorways()
      Returns the value of the avoidMotorways record component.
      Returns:
      the value of the avoidMotorways record component
    • avoidTolls

      public boolean avoidTolls()
      Returns the value of the avoidTolls record component.
      Returns:
      the value of the avoidTolls record component
    • avoidTunnels

      public boolean avoidTunnels()
      Returns the value of the avoidTunnels record component.
      Returns:
      the value of the avoidTunnels record component