Package com.group21.jobTracker.backend
Class DataService
- java.lang.Object
-
- com.group21.jobTracker.backend.DataService
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ApplicationSearchDataService,JobDataService,MockDataService
public abstract class DataService extends Object implements Serializable
This interface is used to retrieve and update data to and from the CSV files. It is also used to populate grids on the UI.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DataService()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DataServiceget()Return an instance of MockDataService.abstract Collection<Jobs>getAllJobs()Returns a list of jobs from the CSV file.static DataServicegetJob()Returns a JobDataService objectabstract JobsgetJobsbyId(int jobId)Return a Jobs object from the CSV file given an id.static DataServicegetSearchResults(String keywords)Returns a ApplicationSearchDataService object
-
-
-
Method Detail
-
getAllJobs
public abstract Collection<Jobs> getAllJobs()
Returns a list of jobs from the CSV file.- Returns:
- List of Jobs objects
-
getJobsbyId
public abstract Jobs getJobsbyId(int jobId)
Return a Jobs object from the CSV file given an id.- Parameters:
jobId- id of the Jobs object you are searching for- Returns:
- the Jobs object with the given id
-
get
public static DataService get()
Return an instance of MockDataService.- Returns:
- instance of MockDataService
-
getJob
public static DataService getJob()
Returns a JobDataService object- Returns:
- JobDataService object
-
getSearchResults
public static DataService getSearchResults(String keywords)
Returns a ApplicationSearchDataService object- Parameters:
keywords- limits the search for API calls- Returns:
- ApplicationSearchDataService object
-
-