Package org.onebusaway.gtfs.model
Class AgencyAndId
- java.lang.Object
-
- org.onebusaway.gtfs.model.AgencyAndId
-
- All Implemented Interfaces:
Serializable,Comparable<AgencyAndId>
public class AgencyAndId extends Object implements Serializable, Comparable<AgencyAndId>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static charID_SEPARATOR
-
Constructor Summary
Constructors Constructor Description AgencyAndId()AgencyAndId(String agencyId, String id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(AgencyAndId o)static AgencyAndIdconvertFromString(String value)Given an id of the form "agencyId_entityId", parses into aAgencyAndIdid object.static AgencyAndIdconvertFromString(String value, char separator)Given an id of the form "agencyId_entityId", parses into aAgencyAndIdid object.static StringconvertToString(AgencyAndId aid)Given anAgencyAndIdobject, creates a string representation of the form "agencyId_entityId"booleanequals(Object obj)StringgetAgencyId()StringgetId()inthashCode()booleanhasValues()voidsetAgencyId(String agencyId)voidsetId(String id)StringtoString()
-
-
-
Field Detail
-
ID_SEPARATOR
public static final char ID_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAgencyId
public String getAgencyId()
-
setAgencyId
public void setAgencyId(String agencyId)
-
getId
public String getId()
-
setId
public void setId(String id)
-
hasValues
public boolean hasValues()
-
compareTo
public int compareTo(AgencyAndId o)
- Specified by:
compareToin interfaceComparable<AgencyAndId>
-
convertFromString
public static AgencyAndId convertFromString(String value, char separator)
Given an id of the form "agencyId_entityId", parses into aAgencyAndIdid object.- Parameters:
value- id of the form "agencyId_entityId"- Returns:
- an id object
-
convertFromString
public static AgencyAndId convertFromString(String value) throws IllegalArgumentException
Given an id of the form "agencyId_entityId", parses into aAgencyAndIdid object.- Parameters:
value- id of the form "agencyId_entityId"- Returns:
- an id object
- Throws:
IllegalArgumentException- if the id cannot be parsed
-
convertToString
public static String convertToString(AgencyAndId aid)
Given anAgencyAndIdobject, creates a string representation of the form "agencyId_entityId"- Parameters:
aid- an id object- Returns:
- a string representation of the form "agencyId_entityId"
-
-