Package com.uca.flights
Class CityId
- java.lang.Object
-
- com.uca.flights.CityId
-
-
Constructor Summary
Constructors Constructor Description CityId(java.lang.String value)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(CityId other)Redefinition of compareTobooleanequals(java.lang.Object other)Redefinition of equalsjava.lang.StringgetValue()GetterinthashCode()Redefinition of hashCodeintlength()Getterjava.lang.StringtoString()Redefinition of toString
-
-
-
Method Detail
-
getValue
public java.lang.String getValue()
Getter- Returns:
- city id value
-
length
public int length()
Getter- Returns:
- city id length
-
toString
public java.lang.String toString()
Redefinition of toString- Overrides:
toStringin classjava.lang.Object- Returns:
- the value of the city id
-
compareTo
public int compareTo(CityId other)
Redefinition of compareTo- Specified by:
compareToin interfacejava.lang.Comparable<CityId>- Parameters:
other- the CityId to compare to- Returns:
- 0 if other has the same value, 1 else
- Throws:
java.lang.IllegalArgumentException- on null parameter
-
equals
public boolean equals(java.lang.Object other)
Redefinition of equals- Overrides:
equalsin classjava.lang.Object- Parameters:
other- the cityId to compare to- Returns:
- true if other has the same value, false else
- Throws:
java.lang.IllegalArgumentException- on null or not CityId parameter
-
hashCode
public int hashCode()
Redefinition of hashCode- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode
-
-