Package com.openclassrooms.tourguide.dto
Record Class NearbyAttractionDTO
java.lang.Object
java.lang.Record
com.openclassrooms.tourguide.dto.NearbyAttractionDTO
-
Constructor Summary
ConstructorsConstructorDescriptionNearbyAttractionDTO
(gpsUtil.location.Attraction attraction, gpsUtil.location.VisitedLocation visitedLocation, double distance, int rewardPoints) NearbyAttractionDTO
(String attractionName, double attractionLatitude, double attractionLongitude, double userLatitude, double userLongitude, double distance, int rewardPoints) Creates an instance of aNearbyAttractionDTO
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the value of theattractionLatitude
record component.double
Returns the value of theattractionLongitude
record component.Returns the value of theattractionName
record component.double
distance()
Returns the value of thedistance
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of therewardPoints
record component.final String
toString()
Returns a string representation of this record class.double
Returns the value of theuserLatitude
record component.double
Returns the value of theuserLongitude
record component.
-
Constructor Details
-
NearbyAttractionDTO
public NearbyAttractionDTO(gpsUtil.location.Attraction attraction, gpsUtil.location.VisitedLocation visitedLocation, double distance, int rewardPoints) -
NearbyAttractionDTO
public NearbyAttractionDTO(String attractionName, double attractionLatitude, double attractionLongitude, double userLatitude, double userLongitude, double distance, int rewardPoints) Creates an instance of aNearbyAttractionDTO
record class.- Parameters:
attractionName
- the value for theattractionName
record componentattractionLatitude
- the value for theattractionLatitude
record componentattractionLongitude
- the value for theattractionLongitude
record componentuserLatitude
- the value for theuserLatitude
record componentuserLongitude
- the value for theuserLongitude
record componentdistance
- the value for thedistance
record componentrewardPoints
- the value for therewardPoints
record 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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
attractionName
Returns the value of theattractionName
record component.- Returns:
- the value of the
attractionName
record component
-
attractionLatitude
public double attractionLatitude()Returns the value of theattractionLatitude
record component.- Returns:
- the value of the
attractionLatitude
record component
-
attractionLongitude
public double attractionLongitude()Returns the value of theattractionLongitude
record component.- Returns:
- the value of the
attractionLongitude
record component
-
userLatitude
public double userLatitude()Returns the value of theuserLatitude
record component.- Returns:
- the value of the
userLatitude
record component
-
userLongitude
public double userLongitude()Returns the value of theuserLongitude
record component.- Returns:
- the value of the
userLongitude
record component
-
distance
public double distance()Returns the value of thedistance
record component.- Returns:
- the value of the
distance
record component
-
rewardPoints
public int rewardPoints()Returns the value of therewardPoints
record component.- Returns:
- the value of the
rewardPoints
record component
-