public final class NSAPI extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
API_VERSION
The NationStates API version this wrapper uses.
|
| Constructor and Description |
|---|
NSAPI() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getUserAgent()
Getter for the User Agent.
|
static NationQuery |
nation(String nationName)
Starts building a nation query, using the given nation name.
|
static NationDumpQuery |
nationdump(DailyDumpMode mode)
Starts building a query that retrieves the daily nation dump.
|
static ByteArrayOutputStream |
objectToXml(Object obj)
Deprecated.
|
static RegionQuery |
region(String regionName)
Starts building a region query, using the given region name.
|
static RegionDumpQuery |
regiondump(DailyDumpMode mode)
Starts building a query that retrieves the daily region dump.
|
static void |
registerJaxbTypes(Class... types)
Deprecated.
|
static void |
setUserAgent(String userAgent)
Sets the User Agent.
|
static TelegramQuery |
telegram(String clientKey,
String telegramId,
String secretKey,
String... nations)
Starts building a query that sends (a) telegram(s).
|
static VerifyQuery |
verify(String nation,
String checksum)
Starts building a query that verifies a nation.
|
static VersionQuery |
version()
Starts building a query that retrieves the version number of the latest
live NationStates API.
|
static WAQuery |
wa(Council council)
Starts building a World Assembly query, using the selected council type.
|
static WorldQuery |
world(WorldShard... shards)
Starts building a world query, using the selected shards.
|
static <T> T |
xmlToObject(InputStream xml,
Class<T> toType)
Deprecated.
|
public static final int API_VERSION
@Deprecated public static final void registerJaxbTypes(Class... types)
types - the classes to add to the JAXB context@Deprecated public static final <T> T xmlToObject(InputStream xml, Class<T> toType)
T - the type to parse toxml - the XML streamtoType - the type to parse to@Deprecated public static final ByteArrayOutputStream objectToXml(Object obj)
obj - object to parse to output streampublic static void setUserAgent(String userAgent)
userAgent - the User Agent to use for API callspublic static String getUserAgent()
public static NationQuery nation(String nationName)
nationName - name of the nation to querypublic static RegionQuery region(String regionName)
regionName - name of the region to querypublic static WorldQuery world(WorldShard... shards)
shards - the selected shardspublic static WAQuery wa(Council council)
council - the council type to querypublic static VersionQuery version()
public static VerifyQuery verify(String nation, String checksum)
nation - the nation to verifychecksum - the verification checksumpublic static TelegramQuery telegram(String clientKey, String telegramId, String secretKey, String... nations)
clientKey - the client keytelegramId - the telegram idsecretKey - the telegram's secret keynations - the nation(s) to send the telegram topublic static RegionDumpQuery regiondump(DailyDumpMode mode)
mode - the daily dump mode to usepublic static NationDumpQuery nationdump(DailyDumpMode mode)
mode - the daily dump mode to useCopyright © 2016. All rights reserved.