Package models

Class Route

java.lang.Object
models.Route
All Implemented Interfaces:
Serializable, Comparable<Route>

public class Route extends Object implements Comparable<Route>, Serializable
Model of Route. Main model of the program. Contains getters/setters of each class fields. Some fields have restrictions. It's signed under every method of field.
Since:
1.0
See Also:
  • Constructor Details

    • Route

      public Route()
  • Method Details

    • getId

      public Long getId()
      Restrictions: Field cannot be null. The value of this field should be unique, greater than 0 and automatically generated.
      Returns:
      Value of field id
    • setId

      public void setId (Long id)
      Restrictions: Field cannot be null. The value of this field should be unique, greater than 0 and automatically generated.
      Parameters:
      id - Value of field id
    • getName

      public String getName()
      Restrictions: Field cannot be null. String must not be empty.
      Returns:
      Value of field name
    • setName

      public void setName (String name)
      Restrictions: Field cannot be null. String must not be empty.
      Parameters:
      name - Value of field name
    • getCoordinates

      public Coordinates getCoordinates()
      Restrictions: Field cannot be null.
      Returns:
      Value of field coordinates
    • setCoordinates

      public void setCoordinates (Coordinates coordinates)
      Restrictions: Field cannot be null.
      Parameters:
      coordinates - Value of field coordinates
    • getCreationDate

      public Date getCreationDate()
      Restrictions: Field cannot be null and the value of this field should be automatically generated.
      Returns:
      Value of field creationDate
    • setCreationDate

      public void setCreationDate (Date creationDate)
      Restrictions: Field cannot be null and the value of this field should be automatically generated.
      Parameters:
      creationDate - Value of field creationDate
    • getFrom

      public Location getFrom()
      Restrictions: Field can be null.
      Returns:
      Value of field from
    • setFrom

      public void setFrom (Location from)
      Restrictions: Field can be null.
      Parameters:
      from - Value of field from
    • getTo

      public Location getTo()
      Restrictions: Field can be null.
      Returns:
      Value of field to
    • setTo

      public void setTo (Location to)
      Restrictions: Field can be null.
      Parameters:
      to - Value of field to
    • getDistance

      public int getDistance()
      Restrictions: The value of this field should be greater than 1.
      Returns:
      Value of field distance
    • setDistance

      public void setDistance(int distance)
      Restrictions: The value of this field should be greater than 1.
      Parameters:
      distance - Value of field distance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Route o)
      Specified by:
      compareTo in interface Comparable<Route>