public class HardcodedNewsRepository extends Object implements INewsRepository
| Constructor and Description |
|---|
HardcodedNewsRepository(IAppConfig appConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected IAppConfig |
getAppConfig() |
List<INewsEntry> |
getNewsEntries(boolean ascOrder)
Gets all the news entries.
|
INewsEntriesAndTotalNbr |
getNewsEntries(int startPos,
int endPos,
boolean ascOrder)
Gets news entries.
|
protected Map<Long,INewsEntry> |
getNewsEntriesById() |
protected List<INewsEntry> |
getNewsEntriesLocal() |
INewsEntry |
getNewsEntry(long newsId)
Gets a specific news entry.
|
@Inject public HardcodedNewsRepository(IAppConfig appConfig)
protected IAppConfig getAppConfig()
public List<INewsEntry> getNewsEntries(boolean ascOrder)
INewsRepositorygetNewsEntries in interface INewsRepositoryascOrder - If true, returns the entries by their
publication date in ascending order. Otherwise, in descending
order.public INewsEntriesAndTotalNbr getNewsEntries(int startPos, int endPos, boolean ascOrder)
INewsRepositorygetNewsEntries in interface INewsRepositorystartPos - The position of the first entry to return. The first element
is "1", not "0".endPos - The position of the last entry to return (inclusive).ascOrder - If true, returns the entries by their
publication date in ascending order. Otherwise, in descending
order.public INewsEntry getNewsEntry(long newsId)
INewsRepositorygetNewsEntry in interface INewsRepositorynull if not found.protected Map<Long,INewsEntry> getNewsEntriesById()
protected List<INewsEntry> getNewsEntriesLocal()
Copyright © 2016. All rights reserved.