Package slash.navigation.routing
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 -
Constructor Summary
ConstructorsConstructorDescriptionTravelRestrictions(boolean avoidBridges, boolean avoidFerries, boolean avoidMotorways, boolean avoidTolls, boolean avoidTunnels) Creates an instance of aTravelRestrictionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theavoidBridgesrecord component.booleanReturns the value of theavoidFerriesrecord component.booleanReturns the value of theavoidMotorwaysrecord component.booleanReturns the value of theavoidTollsrecord component.booleanReturns the value of theavoidTunnelsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NO_RESTRICTIONS
-
-
Constructor Details
-
TravelRestrictions
public TravelRestrictions(boolean avoidBridges, boolean avoidFerries, boolean avoidMotorways, boolean avoidTolls, boolean avoidTunnels) Creates an instance of aTravelRestrictionsrecord class.- Parameters:
avoidBridges- the value for theavoidBridgesrecord componentavoidFerries- the value for theavoidFerriesrecord componentavoidMotorways- the value for theavoidMotorwaysrecord componentavoidTolls- the value for theavoidTollsrecord componentavoidTunnels- the value for theavoidTunnelsrecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
avoidBridges
public boolean avoidBridges()Returns the value of theavoidBridgesrecord component.- Returns:
- the value of the
avoidBridgesrecord component
-
avoidFerries
public boolean avoidFerries()Returns the value of theavoidFerriesrecord component.- Returns:
- the value of the
avoidFerriesrecord component
-
avoidMotorways
public boolean avoidMotorways()Returns the value of theavoidMotorwaysrecord component.- Returns:
- the value of the
avoidMotorwaysrecord component
-
avoidTolls
public boolean avoidTolls()Returns the value of theavoidTollsrecord component.- Returns:
- the value of the
avoidTollsrecord component
-
avoidTunnels
public boolean avoidTunnels()Returns the value of theavoidTunnelsrecord component.- Returns:
- the value of the
avoidTunnelsrecord component
-