public final class NationStates extends Object implements INationStates
| Constructor and Description |
|---|
NationStates(String userAgent)
Instantiates a new service and sets the User Agent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doVersionCheck()
Performs a simple version check, logging the results in the console.
|
NationQuery |
getNation(String nationName)
Starts building a nation query, using the given nation name.
|
NationDumpQuery |
getNationDump(DailyDumpMode mode)
Starts building a query that retrieves the daily nation dump.
|
RegionQuery |
getRegion(String regionName)
Starts building a region query, using the given region name.
|
RegionDumpQuery |
getRegionDump(DailyDumpMode mode)
Starts building a query that retrieves the daily region dump.
|
VersionQuery |
getVersion()
Starts building a query that retrieves the version number of the latest
live NationStates API.
|
WorldQuery |
getWorld(WorldShard... shards)
Starts building a world query, using the selected shards.
|
WorldAssemblyQuery |
getWorldAssembly(Council council)
Starts building a World Assembly query, using the selected council type.
|
void |
registerTypes(Class... types)
Adds the given classes to the JAXB context so that they can be parsed to
from retrieved XML responses and files.
|
TelegramQuery |
sendTelegrams(String clientKey,
String telegramId,
String secretKey,
String... nations)
Starts building a query that sends (a) telegram(s).
|
void |
setUserAgent(String userAgent)
Sets the User Agent.
|
VerifyQuery |
verifyNation(String nation,
String checksum)
Starts building a query that verifies a nation.
|
public NationStates(String userAgent)
userAgent - the User Agent to use for API callspublic void setUserAgent(String userAgent)
INationStatessetUserAgent in interface INationStatesuserAgent - the User Agent to use for API callspublic void doVersionCheck()
INationStatesdoVersionCheck in interface INationStatespublic final void registerTypes(Class... types)
INationStatesregisterTypes in interface INationStatestypes - the classes to add to the JAXB contextpublic NationQuery getNation(String nationName)
INationStatesgetNation in interface INationStatesnationName - name of the nation to querypublic RegionQuery getRegion(String regionName)
INationStatesgetRegion in interface INationStatesregionName - name of the region to querypublic WorldQuery getWorld(WorldShard... shards)
INationStatesgetWorld in interface INationStatesshards - the selected shardspublic WorldAssemblyQuery getWorldAssembly(Council council)
INationStatesgetWorldAssembly in interface INationStatescouncil - the council type to querypublic VersionQuery getVersion()
INationStatesgetVersion in interface INationStatespublic VerifyQuery verifyNation(String nation, String checksum)
INationStatesverifyNation in interface INationStatesnation - the nation to verifychecksum - the verification checksumpublic TelegramQuery sendTelegrams(String clientKey, String telegramId, String secretKey, String... nations)
INationStatessendTelegrams in interface INationStatesclientKey - the client keytelegramId - the telegram idsecretKey - the telegram's secret keynations - the nation(s) to send the telegram topublic RegionDumpQuery getRegionDump(DailyDumpMode mode)
INationStatesgetRegionDump in interface INationStatesmode - the daily dump mode to usepublic NationDumpQuery getNationDump(DailyDumpMode mode)
INationStatesgetNationDump in interface INationStatesmode - the daily dump mode to useCopyright © 2017. All rights reserved.