diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html new file mode 100644 index 0000000..c1e167d --- /dev/null +++ b/doc/allclasses-frame.html @@ -0,0 +1,21 @@ + + + +
+ +Method and Description | +
---|
tk.cavariux.twitchirc.Chat.User.toString()
+ No need on using it, if you put the User on a string it will change automatically
+ |
+
tk.cavariux.twitchirc.Chat.Channel.toString()
+ No need of using this, only in small cases
+ |
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+int
value.long
value.float
value.double
value.boolean
value.int
value.long
value.float
value.double
value.boolean
value.true
.int
value.long
value.float
value.double
value.boolean
value.+ + diff --git a/doc/overview-summary.html b/doc/overview-summary.html new file mode 100644 index 0000000..326ded2 --- /dev/null +++ b/doc/overview-summary.html @@ -0,0 +1,139 @@ + + + + + +
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Chat | ++ |
tk.cavariux.twitchirc.Core | ++ |
List<E> values+
private void readObject(ObjectInputStream inputStream) + throws IOException, + ClassNotFoundException+
IOException
ClassNotFoundException
List<E> names+
List<E> values+
int offset+
int line+
int column+
public class Channel
+extends Object
+Constructor and Description | +
---|
Channel(String channel,
+ TwitchBot bot)
+The constructor of the channel object
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+ban(User user)
+Ban a user of the channel (Need Mod)
+ |
+
void |
+clearChat()
+Clears the chat useful for clearing spam (Need Mod)
+ |
+
void |
+comercial()
+Put a comercial on air for 30sec (Need Streamer/Editor)
+ |
+
String[] |
+getViewers()
+Get the currently viewers (This method is on beta so it may not be optimized)
+ |
+
void |
+host(Channel channel)
+Host a channel (Need Streamer/Editor)
+ |
+
void |
+r9kbeta()
+Turn on the r9kbeta feature on Twitch (Need Mod)
+ |
+
void |
+r9kbetaOff()
+Turns off the r9kbeta feature on Twitch (Need Mod)
+ |
+
void |
+slowMode(int sec)
+Slowmode on the chat (Need Mod)
+ |
+
void |
+slowOff()
+Turns off the slowmode (Need Mod)
+ |
+
void |
+subscribersOnly()
+Turns the chat on subscribers only (Need Mod) (The channel needs partner with twitch)
+ |
+
void |
+suscribersOnlyOff()
+Turns off the chat only room (Need Mod)
+ |
+
void |
+timeOut(User user,
+ int time)
+Timeout a player on the chat, useful for clearing spam (Need Mod)
+ |
+
String |
+toString()
+Deprecated.
+
+No need of using this, only in small cases
+ |
+
void |
+unBan(User user)
+Unban a user from the chat (Need Mod)
+ |
+
void |
+unhost()
+Unhost the hosted channel (Need Streamer/Editor)
+ |
+
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Channel(String channel, + TwitchBot bot)+
channel
- The name of the Channelbot
- The bot that will be linked with@Deprecated +public final String toString()+
toString
in class Object
public final void ban(User user)+
user
- The user that will be bannedpublic final void timeOut(User user, + int time)+
user
- The user that will be timeouttime
- The time that will get timeout (Sometimes twitch change this)public final void unBan(User user)+
user
- The user that will get unbanpublic final void slowMode(int sec)+
sec
- seconds of cooldown between messages of a userpublic final void slowOff()+
public final void subscribersOnly()+
public final void suscribersOnlyOff()+
public final void clearChat()+
public final void r9kbeta()+
public final void r9kbetaOff()+
public final void comercial()+
public final void host(Channel channel)+
channel
- The target of the hostpublic final void unhost()+
public final String[] getViewers()+
public class User
+extends Object
+Constructor and Description | +
---|
User(String user)
+The constructor for a user.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+isOp(Channel channel)
+Check if the User is op (May bug out some times) (Method in beta may not be optimized)
+ |
+
String |
+toString()
+Deprecated.
+
+No need on using it, if you put the User on a string it will change automatically
+ |
+
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public User(String user)+
user
- The name of the User@Deprecated +public String toString()+
toString
in class Object
public final boolean isOp(Channel channel)+
channel
- The channel to checkPackage | +Description | +
---|---|
tk.cavariux.twitchirc.Chat | ++ |
tk.cavariux.twitchirc.Core | ++ |
Modifier and Type | +Method and Description | +
---|---|
void |
+Channel.host(Channel channel)
+Host a channel (Need Streamer/Editor)
+ |
+
boolean |
+User.isOp(Channel channel)
+Check if the User is op (May bug out some times) (Method in beta may not be optimized)
+ |
+
Modifier and Type | +Method and Description | +
---|---|
Channel |
+TwitchBot.joinChannel(String channel)
+The method to join an IRC channel on Twitch
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+TwitchBot.sendMessage(int message,
+ Channel channel)
+A sendMessage variation with an int
+ |
+
void |
+TwitchBot.sendMessage(String message,
+ Channel channel)
+Send a message to a channel on Twitch (Don't need to be on that channel)
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Chat | ++ |
Modifier and Type | +Method and Description | +
---|---|
void |
+Channel.ban(User user)
+Ban a user of the channel (Need Mod)
+ |
+
void |
+Channel.timeOut(User user,
+ int time)
+Timeout a player on the chat, useful for clearing spam (Need Mod)
+ |
+
void |
+Channel.unBan(User user)
+Unban a user from the chat (Need Mod)
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Chat | ++ |
tk.cavariux.twitchirc.Core | ++ |
Class and Description | +
---|
Channel
+ The channel object
+ |
+
User
+ The user object
+ |
+
Class and Description | +
---|
Channel
+ The channel object
+ |
+
public class TwitchBot
+extends Object
+Modifier and Type | +Method and Description | +
---|---|
void |
+connect()
+The connect method alouds you to connect to the IRC servers on twitch
+ |
+
String |
+getVersion()
+Get the version of the TwitchIRC lib
+ |
+
BufferedWriter |
+getWriter()
+No need to use this dev things
+ |
+
Channel |
+joinChannel(String channel)
+The method to join an IRC channel on Twitch
+ |
+
void |
+partChannel(String channel)
+Leaves the channel you want
+ |
+
void |
+sendMessage(int message,
+ Channel channel)
+A sendMessage variation with an int
+ |
+
void |
+sendMessage(String message,
+ Channel channel)
+Send a message to a channel on Twitch (Don't need to be on that channel)
+ |
+
void |
+sendRawMessage(int message)
+An int variation of the sendRawMessage(String)
+ |
+
void |
+sendRawMessage(String message)
+This method is used if you want to send a command to the IRC server, not commontly used
+ |
+
void |
+setOauth_Key(String oauth_key)
+Set the "password" that the connect method will use.
+ |
+
void |
+setUsername(String username)
+Set the username that the connect method will use
+ |
+
void |
+start()
+Starts the full mechanism of the bot, this is the last method to be called
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void connect()+
public final void setUsername(String username)+
username
- Needs your Twitch Username to connectpublic final void setOauth_Key(String oauth_key)+
oauth_key
- To get this key go to the TwitchApps and get it on the TMI sectionpublic void sendRawMessage(String message)+
message
- the command you will sentpublic void sendRawMessage(int message)+
message
- the command you will sentpublic void sendMessage(String message, + Channel channel)+
message
- The message that will be sentchannel
- The channel where the message will be sentpublic void sendMessage(int message, + Channel channel)+
message
- The message that will be sentchannel
- channel The channel where the message will be sentpublic final Channel joinChannel(String channel)+
channel
- The channel namepublic final void partChannel(String channel)+
channel
- The channel you want to leavepublic final BufferedWriter getWriter()+
public final void start()+
public final String getVersion()+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Chat | ++ |
Constructor and Description | +
---|
Channel(String channel,
+ TwitchBot bot)
+The constructor of the channel object
+ |
+
Class | +Description | +
---|---|
TwitchBot | +
+ The main object to start making your bot
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Chat | ++ |
Class and Description | +
---|
TwitchBot
+ The main object to start making your bot
+ |
+
public class JsonArray +extends JsonValue +implements Iterable<JsonValue>+
+ Elements can be added using the add(...)
methods which accept instances of
+ JsonValue
, strings, primitive numbers, and boolean values. To replace an element of an
+ array, use the set(int, ...)
methods.
+
+ Elements can be accessed by their index using get(int)
. This class also supports
+ iterating over the elements in document order using an iterator()
or an enhanced for
+ loop:
+
+ for( JsonValue value : jsonArray ) { + ... + } ++
+ An equivalent List
can be obtained from the method values()
.
+
+ Note that this class is not thread-safe. If multiple threads access a
+ JsonArray
instance concurrently, while at least one of these threads modifies the
+ contents of this array, access to the instance must be synchronized externally. Failure to do so
+ may lead to an inconsistent state.
+
+ This class is not supposed to be extended by clients. +
Constructor and Description | +
---|
JsonArray()
+Creates a new empty JsonArray.
+ |
+
JsonArray(JsonArray array)
+Creates a new JsonArray with the contents of the specified JSON array.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
JsonArray |
+add(boolean value)
+Appends the JSON representation of the specified
+boolean value to the end of this
+ array. |
+
JsonArray |
+add(double value)
+Appends the JSON representation of the specified
+double value to the end of this
+ array. |
+
JsonArray |
+add(float value)
+Appends the JSON representation of the specified
+float value to the end of this
+ array. |
+
JsonArray |
+add(int value)
+Appends the JSON representation of the specified
+int value to the end of this
+ array. |
+
JsonArray |
+add(JsonValue value)
+Appends the specified JSON value to the end of this array.
+ |
+
JsonArray |
+add(long value)
+Appends the JSON representation of the specified
+long value to the end of this
+ array. |
+
JsonArray |
+add(String value)
+Appends the JSON representation of the specified string to the end of this array.
+ |
+
JsonArray |
+asArray()
+Returns this JSON value as
+JsonArray , assuming that this value represents a JSON
+ array. |
+
boolean |
+equals(Object object)
+Indicates whether some other object is "equal to" this one according to the contract specified
+ in
+Object.equals(Object) . |
+
JsonValue |
+get(int index)
+Returns the value of the element at the specified position in this array.
+ |
+
int |
+hashCode() |
+
boolean |
+isArray()
+Detects whether this value represents a JSON array.
+ |
+
boolean |
+isEmpty()
+Returns
+true if this array contains no elements. |
+
Iterator<JsonValue> |
+iterator()
+Returns an iterator over the values of this array in document order.
+ |
+
static JsonArray |
+readFrom(Reader reader)
+Reads a JSON array from the given reader.
+ |
+
static JsonArray |
+readFrom(String string)
+Reads a JSON array from the given string.
+ |
+
JsonArray |
+remove(int index)
+Removes the element at the specified index from this array.
+ |
+
JsonArray |
+set(int index,
+ boolean value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+boolean value. |
+
JsonArray |
+set(int index,
+ double value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+double value. |
+
JsonArray |
+set(int index,
+ float value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+float value. |
+
JsonArray |
+set(int index,
+ int value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+int value. |
+
JsonArray |
+set(int index,
+ JsonValue value)
+Replaces the element at the specified position in this array with the specified JSON value.
+ |
+
JsonArray |
+set(int index,
+ long value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+long value. |
+
JsonArray |
+set(int index,
+ String value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified string.
+ |
+
int |
+size()
+Returns the number of elements in this array.
+ |
+
static JsonArray |
+unmodifiableArray(JsonArray array)
+Returns an unmodifiable wrapper for the specified JsonArray.
+ |
+
List<JsonValue> |
+values()
+Returns a list of the values in this array in document order.
+ |
+
asBoolean, asDouble, asFloat, asInt, asLong, asObject, asString, isBoolean, isFalse, isNull, isNumber, isObject, isString, isTrue, toString, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, writeTo
getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public JsonArray()+
public JsonArray(JsonArray array)+
array
- the JsonArray to get the initial contents from, must not be null
public static JsonArray readFrom(Reader reader) + throws IOException+
+ Characters are read in chunks and buffered internally, therefore wrapping an existing reader in
+ an additional BufferedReader
does not improve reading
+ performance.
+
reader
- the reader to read the JSON array fromIOException
- if an I/O error occurs in the readerParseException
- if the input is not valid JSONUnsupportedOperationException
- if the input does not contain a JSON arraypublic static JsonArray readFrom(String string)+
string
- the string that contains the JSON arrayParseException
- if the input is not valid JSONUnsupportedOperationException
- if the input does not contain a JSON arraypublic static JsonArray unmodifiableArray(JsonArray array)+
+ The returned JsonArray is backed by the given array and reflects subsequent changes. Attempts
+ to modify the returned JsonArray result in an UnsupportedOperationException
.
+
array
- the JsonArray for which an unmodifiable JsonArray is to be returnedpublic JsonArray add(int value)+
int
value to the end of this
+ array.value
- the value to add to the arraypublic JsonArray add(long value)+
long
value to the end of this
+ array.value
- the value to add to the arraypublic JsonArray add(float value)+
float
value to the end of this
+ array.value
- the value to add to the arraypublic JsonArray add(double value)+
double
value to the end of this
+ array.value
- the value to add to the arraypublic JsonArray add(boolean value)+
boolean
value to the end of this
+ array.value
- the value to add to the arraypublic JsonArray add(String value)+
value
- the string to add to the arraypublic JsonArray add(JsonValue value)+
value
- the JsonValue to add to the array, must not be null
public JsonArray set(int index, + int value)+
int
value.index
- the index of the array element to replacevalue
- the value to be stored at the specified array positionIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray set(int index, + long value)+
long
value.index
- the index of the array element to replacevalue
- the value to be stored at the specified array positionIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray set(int index, + float value)+
float
value.index
- the index of the array element to replacevalue
- the value to be stored at the specified array positionIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray set(int index, + double value)+
double
value.index
- the index of the array element to replacevalue
- the value to be stored at the specified array positionIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray set(int index, + boolean value)+
boolean
value.index
- the index of the array element to replacevalue
- the value to be stored at the specified array positionIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray set(int index, + String value)+
index
- the index of the array element to replacevalue
- the string to be stored at the specified array positionIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray set(int index, + JsonValue value)+
index
- the index of the array element to replacevalue
- the value to be stored at the specified array position, must not be null
IndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public JsonArray remove(int index)+
index
- the index of the element to removeIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public int size()+
public boolean isEmpty()+
true
if this array contains no elements.true
if this array contains no elementspublic JsonValue get(int index)+
index
- the index of the array element to returnIndexOutOfBoundsException
- if the index is out of range, i.e. index < 0
or
+ index >= size
public List<JsonValue> values()+
public Iterator<JsonValue> iterator()+
iterator
in interface Iterable<JsonValue>
public boolean isArray()+
JsonValue
JsonArray
.public JsonArray asArray()+
JsonValue
JsonArray
, assuming that this value represents a JSON
+ array. If this is not the case, an exception is thrown.public boolean equals(Object object)+
JsonValue
Object.equals(Object)
.
+ + Two JsonValues are considered equal if and only if they represent the same JSON text. As a + consequence, two given JsonObjects may be different even though they contain the same set of + names with the same values, but in a different order. +
public static class JsonObject.Member
+extends Object
+Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(Object obj) |
+
String |
+getName()
+Returns the name of this member.
+ |
+
JsonValue |
+getValue()
+Returns the value of this member.
+ |
+
int |
+hashCode() |
+
getClass, notify, notifyAll, toString, wait, wait, wait
public String getName()+
null
public JsonValue getValue()+
null
public int hashCode()+
hashCode
in class Object
public boolean equals(Object obj)+
equals
in class Object
public class JsonObject +extends JsonValue +implements Iterable<JsonObject.Member>+
+ Members can be added using the add(String, ...)
methods which accept instances of
+ JsonValue
, strings, primitive numbers, and boolean values. To modify certain values of an
+ object, use the set(String, ...)
methods. Please note that the add
+ methods are faster than set
as they do not search for existing members. On the other
+ hand, the add
methods do not prevent adding multiple members with the same name.
+ Duplicate names are discouraged but not prohibited by JSON.
+
+ Members can be accessed by their name using get(String)
. A list of all names can be
+ obtained from the method names()
. This class also supports iterating over the members in
+ document order using an iterator()
or an enhanced for loop:
+
+ for( Member member : jsonObject ) { + String name = member.getName(); + JsonValue value = member.getValue(); + ... + } ++
+ Even though JSON objects are unordered by definition, instances of this class preserve the order + of members to allow processing in document order and to guarantee a predictable output. +
+
+ Note that this class is not thread-safe. If multiple threads access a
+ JsonObject
instance concurrently, while at least one of these threads modifies the
+ contents of this object, access to the instance must be synchronized externally. Failure to do so
+ may lead to an inconsistent state.
+
+ This class is not supposed to be extended by clients. +
Modifier and Type | +Class and Description | +
---|---|
static class |
+JsonObject.Member
+Represents a member of a JSON object, i.e. a pair of name and value.
+ |
+
Constructor and Description | +
---|
JsonObject()
+Creates a new empty JsonObject.
+ |
+
JsonObject(JsonObject object)
+Creates a new JsonObject, initialized with the contents of the specified JSON object.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
JsonObject |
+add(String name,
+ boolean value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+boolean value. |
+
JsonObject |
+add(String name,
+ double value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+double value. |
+
JsonObject |
+add(String name,
+ float value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+float value. |
+
JsonObject |
+add(String name,
+ int value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+int value. |
+
JsonObject |
+add(String name,
+ JsonValue value)
+Appends a new member to the end of this object, with the specified name and the specified JSON
+ value.
+ |
+
JsonObject |
+add(String name,
+ long value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+long value. |
+
JsonObject |
+add(String name,
+ String value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified string.
+ |
+
JsonObject |
+asObject()
+Returns this JSON value as
+JsonObject , assuming that this value represents a JSON
+ object. |
+
boolean |
+equals(Object obj)
+Indicates whether some other object is "equal to" this one according to the contract specified
+ in
+Object.equals(Object) . |
+
JsonValue |
+get(String name)
+Returns the value of the member with the specified name in this object.
+ |
+
boolean |
+getBoolean(String name,
+ boolean defaultValue)
+Returns the
+boolean value of the member with the specified name in this object. |
+
double |
+getDouble(String name,
+ double defaultValue)
+Returns the
+double value of the member with the specified name in this object. |
+
float |
+getFloat(String name,
+ float defaultValue)
+Returns the
+float value of the member with the specified name in this object. |
+
int |
+getInt(String name,
+ int defaultValue)
+Returns the
+int value of the member with the specified name in this object. |
+
long |
+getLong(String name,
+ long defaultValue)
+Returns the
+long value of the member with the specified name in this object. |
+
String |
+getString(String name,
+ String defaultValue)
+Returns the
+String value of the member with the specified name in this object. |
+
int |
+hashCode() |
+
boolean |
+isEmpty()
+Returns
+true if this object contains no members. |
+
boolean |
+isObject()
+Detects whether this value represents a JSON object.
+ |
+
Iterator<JsonObject.Member> |
+iterator()
+Returns an iterator over the members of this object in document order.
+ |
+
List<String> |
+names()
+Returns a list of the names in this object in document order.
+ |
+
static JsonObject |
+readFrom(Reader reader)
+Reads a JSON object from the given reader.
+ |
+
static JsonObject |
+readFrom(String string)
+Reads a JSON object from the given string.
+ |
+
JsonObject |
+remove(String name)
+Removes a member with the specified name from this object.
+ |
+
JsonObject |
+set(String name,
+ boolean value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+boolean value. |
+
JsonObject |
+set(String name,
+ double value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+double value. |
+
JsonObject |
+set(String name,
+ float value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+float value. |
+
JsonObject |
+set(String name,
+ int value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+int value. |
+
JsonObject |
+set(String name,
+ JsonValue value)
+Sets the value of the member with the specified name to the specified JSON value.
+ |
+
JsonObject |
+set(String name,
+ long value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+long value. |
+
JsonObject |
+set(String name,
+ String value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified string.
+ |
+
int |
+size()
+Returns the number of members (i.e. name/value pairs) in this object.
+ |
+
static JsonObject |
+unmodifiableObject(JsonObject object)
+Returns an unmodifiable JsonObject for the specified one.
+ |
+
asArray, asBoolean, asDouble, asFloat, asInt, asLong, asString, isArray, isBoolean, isFalse, isNull, isNumber, isString, isTrue, toString, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, writeTo
getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public JsonObject()+
public JsonObject(JsonObject object)+
object
- the JSON object to get the initial contents from, must not be null
public static JsonObject readFrom(Reader reader) + throws IOException+
+ Characters are read in chunks and buffered internally, therefore wrapping an existing reader in
+ an additional BufferedReader
does not improve reading
+ performance.
+
reader
- the reader to read the JSON object fromIOException
- if an I/O error occurs in the readerParseException
- if the input is not valid JSONUnsupportedOperationException
- if the input does not contain a JSON objectpublic static JsonObject readFrom(String string)+
string
- the string that contains the JSON objectParseException
- if the input is not valid JSONUnsupportedOperationException
- if the input does not contain a JSON objectpublic static JsonObject unmodifiableObject(JsonObject object)+
+ The returned JsonObject is backed by the given object and reflect changes that happen to it.
+ Attempts to modify the returned JsonObject result in an
+ UnsupportedOperationException
.
+
object
- the JsonObject for which an unmodifiable JsonObject is to be returnedpublic JsonObject add(String name, + int value)+
int
value.
+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject add(String name, + long value)+
long
value.
+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject add(String name, + float value)+
float
value.
+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject add(String name, + double value)+
double
value.
+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject add(String name, + boolean value)+
boolean
value.
+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject add(String name, + String value)+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject add(String name, + JsonValue value)+
+ This method does not prevent duplicate names. Calling this method with a name
+ that already exists in the object will append another member with the same name. In order to
+ replace existing members, use the method set(name, value)
instead. However,
+ add is much faster than set (because it does not need to
+ search for existing members). Therefore add should be preferred when constructing new
+ objects.
+
name
- the name of the member to addvalue
- the value of the member to add, must not be null
public JsonObject set(String name, + int value)+
int
value. If this object does not contain a member with this name, a
+ new member is added at the end of the object. If this object contains multiple members with
+ this name, only the last one is changed.
+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to replacevalue
- the value to set to the memberpublic JsonObject set(String name, + long value)+
long
value. If this object does not contain a member with this name, a
+ new member is added at the end of the object. If this object contains multiple members with
+ this name, only the last one is changed.
+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to replacevalue
- the value to set to the memberpublic JsonObject set(String name, + float value)+
float
value. If this object does not contain a member with this name, a
+ new member is added at the end of the object. If this object contains multiple members with
+ this name, only the last one is changed.
+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject set(String name, + double value)+
double
value. If this object does not contain a member with this name, a
+ new member is added at the end of the object. If this object contains multiple members with
+ this name, only the last one is changed.
+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject set(String name, + boolean value)+
boolean
value. If this object does not contain a member with this name,
+ a new member is added at the end of the object. If this object contains multiple members with
+ this name, only the last one is changed.
+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject set(String name, + String value)+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to addvalue
- the value of the member to addpublic JsonObject set(String name, + JsonValue value)+
+ This method should only be used to modify existing objects. To fill a new
+ object with members, the method add(name, value)
should be preferred which is much
+ faster (as it does not need to search for existing members).
+
name
- the name of the member to addvalue
- the value of the member to add, must not be null
public JsonObject remove(String name)+
name
- the name of the member to removepublic JsonValue get(String name)+
name
- the name of the member whose value is to be returnednull
if this
+ object does not contain a member with that namepublic int getInt(String name, + int defaultValue)+
int
value of the member with the specified name in this object. If
+ this object does not contain a member with this name, the given default value is returned. If
+ this object contains multiple members with the given name, the last one will be picked. If this
+ member's value does not represent a JSON number or if it cannot be interpreted as Java
+ int
, an exception is thrown.name
- the name of the member whose value is to be returneddefaultValue
- the value to be returned if the requested member is missingpublic long getLong(String name, + long defaultValue)+
long
value of the member with the specified name in this object. If
+ this object does not contain a member with this name, the given default value is returned. If
+ this object contains multiple members with the given name, the last one will be picked. If this
+ member's value does not represent a JSON number or if it cannot be interpreted as Java
+ long
, an exception is thrown.name
- the name of the member whose value is to be returneddefaultValue
- the value to be returned if the requested member is missingpublic float getFloat(String name, + float defaultValue)+
float
value of the member with the specified name in this object. If
+ this object does not contain a member with this name, the given default value is returned. If
+ this object contains multiple members with the given name, the last one will be picked. If this
+ member's value does not represent a JSON number or if it cannot be interpreted as Java
+ float
, an exception is thrown.name
- the name of the member whose value is to be returneddefaultValue
- the value to be returned if the requested member is missingpublic double getDouble(String name, + double defaultValue)+
double
value of the member with the specified name in this object. If
+ this object does not contain a member with this name, the given default value is returned. If
+ this object contains multiple members with the given name, the last one will be picked. If this
+ member's value does not represent a JSON number or if it cannot be interpreted as Java
+ double
, an exception is thrown.name
- the name of the member whose value is to be returneddefaultValue
- the value to be returned if the requested member is missingpublic boolean getBoolean(String name, + boolean defaultValue)+
boolean
value of the member with the specified name in this object. If
+ this object does not contain a member with this name, the given default value is returned. If
+ this object contains multiple members with the given name, the last one will be picked. If this
+ member's value does not represent a JSON true
or false
value, an
+ exception is thrown.name
- the name of the member whose value is to be returneddefaultValue
- the value to be returned if the requested member is missingpublic String getString(String name, + String defaultValue)+
String
value of the member with the specified name in this object. If
+ this object does not contain a member with this name, the given default value is returned. If
+ this object contains multiple members with the given name, the last one is picked. If this
+ member's value does not represent a JSON string, an exception is thrown.name
- the name of the member whose value is to be returneddefaultValue
- the value to be returned if the requested member is missingpublic int size()+
public boolean isEmpty()+
true
if this object contains no members.true
if this object contains no memberspublic List<String> names()+
public Iterator<JsonObject.Member> iterator()+
iterator
in interface Iterable<JsonObject.Member>
public boolean isObject()+
JsonValue
JsonObject
.public JsonObject asObject()+
JsonValue
JsonObject
, assuming that this value represents a JSON
+ object. If this is not the case, an exception is thrown.public boolean equals(Object obj)+
JsonValue
Object.equals(Object)
.
+ + Two JsonValues are considered equal if and only if they represent the same JSON text. As a + consequence, two given JsonObjects may be different even though they contain the same set of + names with the same values, but in a different order. +
public abstract class JsonValue
+extends Object
+implements Serializable
+
+ The literals true, false, and null are
+ represented by the constants TRUE
, FALSE
, and NULL
.
+
+ JSON objects and arrays are represented by the subtypes
+ JsonObject
and JsonArray
. Instances of these types can be created using the
+ public constructors of these classes.
+
+ Instances that represent JSON numbers, strings and
+ boolean values can be created using the static factory methods
+ valueOf(String)
, valueOf(long)
, valueOf(double)
, etc.
+
+ In order to find out whether an instance of this class is of a certain type, the methods
+ isObject()
, isArray()
, isString()
, isNumber()
etc. can be
+ used.
+
+ If the type of a JSON value is known, the methods asObject()
, asArray()
,
+ asString()
, asInt()
, etc. can be used to get this value directly in the
+ appropriate target type.
+
+ This class is not supposed to be extended by clients. +
Modifier and Type | +Field and Description | +
---|---|
static JsonValue |
+FALSE
+Represents the JSON literal
+false . |
+
static JsonValue |
+NULL
+The JSON literal
+null . |
+
static JsonValue |
+TRUE
+Represents the JSON literal
+true . |
+
Modifier and Type | +Method and Description | +
---|---|
JsonArray |
+asArray()
+Returns this JSON value as
+JsonArray , assuming that this value represents a JSON
+ array. |
+
boolean |
+asBoolean()
+Returns this JSON value as a
+boolean value, assuming that this value is either
+ true or false . |
+
double |
+asDouble()
+Returns this JSON value as a
+double value, assuming that this value represents a
+ JSON number. |
+
float |
+asFloat()
+Returns this JSON value as a
+float value, assuming that this value represents a
+ JSON number. |
+
int |
+asInt()
+Returns this JSON value as an
+int value, assuming that this value represents a
+ JSON number that can be interpreted as Java int . |
+
long |
+asLong()
+Returns this JSON value as a
+long value, assuming that this value represents a
+ JSON number that can be interpreted as Java long . |
+
JsonObject |
+asObject()
+Returns this JSON value as
+JsonObject , assuming that this value represents a JSON
+ object. |
+
String |
+asString()
+Returns this JSON value as String, assuming that this value represents a JSON string.
+ |
+
boolean |
+equals(Object object)
+Indicates whether some other object is "equal to" this one according to the contract specified
+ in
+Object.equals(Object) . |
+
int |
+hashCode() |
+
boolean |
+isArray()
+Detects whether this value represents a JSON array.
+ |
+
boolean |
+isBoolean()
+Detects whether this value represents a boolean value.
+ |
+
boolean |
+isFalse()
+Detects whether this value represents the JSON literal
+false . |
+
boolean |
+isNull()
+Detects whether this value represents the JSON literal
+null . |
+
boolean |
+isNumber()
+Detects whether this value represents a JSON number.
+ |
+
boolean |
+isObject()
+Detects whether this value represents a JSON object.
+ |
+
boolean |
+isString()
+Detects whether this value represents a JSON string.
+ |
+
boolean |
+isTrue()
+Detects whether this value represents the JSON literal
+true . |
+
static JsonValue |
+readFrom(Reader reader)
+Reads a JSON value from the given reader.
+ |
+
static JsonValue |
+readFrom(String text)
+Reads a JSON value from the given string.
+ |
+
String |
+toString()
+Returns the JSON string for this value in its minimal form, without any additional whitespace.
+ |
+
static JsonValue |
+valueOf(boolean value)
+Returns a JsonValue instance that represents the given
+boolean value. |
+
static JsonValue |
+valueOf(double value)
+Returns a JsonValue instance that represents the given
+double value. |
+
static JsonValue |
+valueOf(float value)
+Returns a JsonValue instance that represents the given
+float value. |
+
static JsonValue |
+valueOf(int value)
+Returns a JsonValue instance that represents the given
+int value. |
+
static JsonValue |
+valueOf(long value)
+Returns a JsonValue instance that represents the given
+long value. |
+
static JsonValue |
+valueOf(String string)
+Returns a JsonValue instance that represents the given string.
+ |
+
void |
+writeTo(Writer writer)
+Writes the JSON representation for this object to the given writer.
+ |
+
getClass, notify, notifyAll, wait, wait, wait
public static final JsonValue TRUE+
true
.public static final JsonValue FALSE+
false
.public static final JsonValue NULL+
null
.public static JsonValue readFrom(Reader reader) + throws IOException+
+ Characters are read in chunks and buffered internally, therefore wrapping an existing reader in
+ an additional BufferedReader
does not improve reading
+ performance.
+
reader
- the reader to read the JSON value fromIOException
- if an I/O error occurs in the readerParseException
- if the input is not valid JSONpublic static JsonValue readFrom(String text)+
text
- the string that contains the JSON valueParseException
- if the input is not valid JSONpublic static JsonValue valueOf(int value)+
int
value.value
- the value to get a JSON representation forpublic static JsonValue valueOf(long value)+
long
value.value
- the value to get a JSON representation forpublic static JsonValue valueOf(float value)+
float
value.value
- the value to get a JSON representation forpublic static JsonValue valueOf(double value)+
double
value.value
- the value to get a JSON representation forpublic static JsonValue valueOf(String string)+
string
- the string to get a JSON representation forpublic static JsonValue valueOf(boolean value)+
boolean
value.value
- the value to get a JSON representation forpublic boolean isObject()+
JsonObject
.true
if this value is an instance of JsonObjectpublic boolean isArray()+
JsonArray
.true
if this value is an instance of JsonArraypublic boolean isNumber()+
true
if this value represents a JSON numberpublic boolean isString()+
true
if this value represents a JSON stringpublic boolean isBoolean()+
true
if this value represents either the JSON literal
+ true
or false
public boolean isTrue()+
true
.true
if this value represents the JSON literal
+ true
public boolean isFalse()+
false
.true
if this value represents the JSON literal
+ false
public boolean isNull()+
null
.true
if this value represents the JSON literal
+ null
public JsonObject asObject()+
JsonObject
, assuming that this value represents a JSON
+ object. If this is not the case, an exception is thrown.UnsupportedOperationException
- if this value is not a JSON objectpublic JsonArray asArray()+
JsonArray
, assuming that this value represents a JSON
+ array. If this is not the case, an exception is thrown.UnsupportedOperationException
- if this value is not a JSON arraypublic int asInt()+
int
value, assuming that this value represents a
+ JSON number that can be interpreted as Java int
. If this is not the case, an
+ exception is thrown.
+
+ To be interpreted as Java int
, the JSON number must neither contain an exponent
+ nor a fraction part. Moreover, the number must be in the Integer
range.
+
int
UnsupportedOperationException
- if this value is not a JSON numberNumberFormatException
- if this JSON number can not be interpreted as int
valuepublic long asLong()+
long
value, assuming that this value represents a
+ JSON number that can be interpreted as Java long
. If this is not the case, an
+ exception is thrown.
+
+ To be interpreted as Java long
, the JSON number must neither contain an exponent
+ nor a fraction part. Moreover, the number must be in the Long
range.
+
long
UnsupportedOperationException
- if this value is not a JSON numberNumberFormatException
- if this JSON number can not be interpreted as long
valuepublic float asFloat()+
float
value, assuming that this value represents a
+ JSON number. If this is not the case, an exception is thrown.
+
+ If the JSON number is out of the Float
range, Float.POSITIVE_INFINITY
or
+ Float.NEGATIVE_INFINITY
is returned.
+
float
UnsupportedOperationException
- if this value is not a JSON numberpublic double asDouble()+
double
value, assuming that this value represents a
+ JSON number. If this is not the case, an exception is thrown.
+
+ If the JSON number is out of the Double
range, Double.POSITIVE_INFINITY
or
+ Double.NEGATIVE_INFINITY
is returned.
+
double
UnsupportedOperationException
- if this value is not a JSON numberpublic String asString()+
UnsupportedOperationException
- if this value is not a JSON stringpublic boolean asBoolean()+
boolean
value, assuming that this value is either
+ true
or false
. If this is not the case, an exception is thrown.boolean
UnsupportedOperationException
- if this value is neither true
or false
public void writeTo(Writer writer) + throws IOException+
+ Single elements are passed directly to the given writer. Therefore, if the writer is not
+ buffered, wrapping it in a BufferedWriter
can drastically
+ improve writing performance.
+
writer
- the writer to write this value toIOException
- if an I/O error occurs in the writerpublic String toString()+
readFrom(String)
and to
+ create a value that is equal to this object.toString
in class Object
public boolean equals(Object object)+
Object.equals(Object)
.
+ + Two JsonValues are considered equal if and only if they represent the same JSON text. As a + consequence, two given JsonObjects may be different even though they contain the same set of + names with the same values, but in a different order. +
equals
in class Object
object
- the reference object with which to comparepublic int hashCode()+
hashCode
in class Object
public class ParseException
+extends RuntimeException
+Modifier and Type | +Method and Description | +
---|---|
int |
+getColumn()
+Returns the index of the character at which the error occurred, relative to the line.
+ |
+
int |
+getLine()
+Returns the number of the line in which the error occurred.
+ |
+
int |
+getOffset()
+Returns the absolute index of the character at which the error occurred.
+ |
+
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public int getOffset()+
public int getLine()+
public int getColumn()+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Json | ++ |
Modifier and Type | +Method and Description | +
---|---|
JsonArray |
+JsonArray.add(boolean value)
+Appends the JSON representation of the specified
+boolean value to the end of this
+ array. |
+
JsonArray |
+JsonArray.add(double value)
+Appends the JSON representation of the specified
+double value to the end of this
+ array. |
+
JsonArray |
+JsonArray.add(float value)
+Appends the JSON representation of the specified
+float value to the end of this
+ array. |
+
JsonArray |
+JsonArray.add(int value)
+Appends the JSON representation of the specified
+int value to the end of this
+ array. |
+
JsonArray |
+JsonArray.add(JsonValue value)
+Appends the specified JSON value to the end of this array.
+ |
+
JsonArray |
+JsonArray.add(long value)
+Appends the JSON representation of the specified
+long value to the end of this
+ array. |
+
JsonArray |
+JsonArray.add(String value)
+Appends the JSON representation of the specified string to the end of this array.
+ |
+
JsonArray |
+JsonValue.asArray()
+Returns this JSON value as
+JsonArray , assuming that this value represents a JSON
+ array. |
+
JsonArray |
+JsonArray.asArray() |
+
static JsonArray |
+JsonArray.readFrom(Reader reader)
+Reads a JSON array from the given reader.
+ |
+
static JsonArray |
+JsonArray.readFrom(String string)
+Reads a JSON array from the given string.
+ |
+
JsonArray |
+JsonArray.remove(int index)
+Removes the element at the specified index from this array.
+ |
+
JsonArray |
+JsonArray.set(int index,
+ boolean value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+boolean value. |
+
JsonArray |
+JsonArray.set(int index,
+ double value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+double value. |
+
JsonArray |
+JsonArray.set(int index,
+ float value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+float value. |
+
JsonArray |
+JsonArray.set(int index,
+ int value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+int value. |
+
JsonArray |
+JsonArray.set(int index,
+ JsonValue value)
+Replaces the element at the specified position in this array with the specified JSON value.
+ |
+
JsonArray |
+JsonArray.set(int index,
+ long value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified
+long value. |
+
JsonArray |
+JsonArray.set(int index,
+ String value)
+Replaces the element at the specified position in this array with the JSON representation of
+ the specified string.
+ |
+
static JsonArray |
+JsonArray.unmodifiableArray(JsonArray array)
+Returns an unmodifiable wrapper for the specified JsonArray.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static JsonArray |
+JsonArray.unmodifiableArray(JsonArray array)
+Returns an unmodifiable wrapper for the specified JsonArray.
+ |
+
Constructor and Description | +
---|
JsonArray(JsonArray array)
+Creates a new JsonArray with the contents of the specified JSON array.
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Json | ++ |
Modifier and Type | +Method and Description | +
---|---|
Iterator<JsonObject.Member> |
+JsonObject.iterator()
+Returns an iterator over the members of this object in document order.
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Json | ++ |
Modifier and Type | +Method and Description | +
---|---|
JsonObject |
+JsonObject.add(String name,
+ boolean value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+boolean value. |
+
JsonObject |
+JsonObject.add(String name,
+ double value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+double value. |
+
JsonObject |
+JsonObject.add(String name,
+ float value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+float value. |
+
JsonObject |
+JsonObject.add(String name,
+ int value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+int value. |
+
JsonObject |
+JsonObject.add(String name,
+ JsonValue value)
+Appends a new member to the end of this object, with the specified name and the specified JSON
+ value.
+ |
+
JsonObject |
+JsonObject.add(String name,
+ long value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified
+long value. |
+
JsonObject |
+JsonObject.add(String name,
+ String value)
+Appends a new member to the end of this object, with the specified name and the JSON
+ representation of the specified string.
+ |
+
JsonObject |
+JsonValue.asObject()
+Returns this JSON value as
+JsonObject , assuming that this value represents a JSON
+ object. |
+
JsonObject |
+JsonObject.asObject() |
+
static JsonObject |
+JsonObject.readFrom(Reader reader)
+Reads a JSON object from the given reader.
+ |
+
static JsonObject |
+JsonObject.readFrom(String string)
+Reads a JSON object from the given string.
+ |
+
JsonObject |
+JsonObject.remove(String name)
+Removes a member with the specified name from this object.
+ |
+
JsonObject |
+JsonObject.set(String name,
+ boolean value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+boolean value. |
+
JsonObject |
+JsonObject.set(String name,
+ double value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+double value. |
+
JsonObject |
+JsonObject.set(String name,
+ float value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+float value. |
+
JsonObject |
+JsonObject.set(String name,
+ int value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+int value. |
+
JsonObject |
+JsonObject.set(String name,
+ JsonValue value)
+Sets the value of the member with the specified name to the specified JSON value.
+ |
+
JsonObject |
+JsonObject.set(String name,
+ long value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified
+long value. |
+
JsonObject |
+JsonObject.set(String name,
+ String value)
+Sets the value of the member with the specified name to the JSON representation of the
+ specified string.
+ |
+
static JsonObject |
+JsonObject.unmodifiableObject(JsonObject object)
+Returns an unmodifiable JsonObject for the specified one.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static JsonObject |
+JsonObject.unmodifiableObject(JsonObject object)
+Returns an unmodifiable JsonObject for the specified one.
+ |
+
Constructor and Description | +
---|
JsonObject(JsonObject object)
+Creates a new JsonObject, initialized with the contents of the specified JSON object.
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Json | ++ |
Modifier and Type | +Class and Description | +
---|---|
class |
+JsonArray
+Represents a JSON array, i.e. an ordered collection of JSON values.
+ |
+
class |
+JsonObject
+Represents a JSON object, i.e. an unordered set of name/value pairs, where the names are strings
+ and the values are JSON values.
+ |
+
Modifier and Type | +Field and Description | +
---|---|
static JsonValue |
+JsonValue.FALSE
+Represents the JSON literal
+false . |
+
static JsonValue |
+JsonValue.NULL
+The JSON literal
+null . |
+
static JsonValue |
+JsonValue.TRUE
+Represents the JSON literal
+true . |
+
Modifier and Type | +Method and Description | +
---|---|
JsonValue |
+JsonArray.get(int index)
+Returns the value of the element at the specified position in this array.
+ |
+
JsonValue |
+JsonObject.get(String name)
+Returns the value of the member with the specified name in this object.
+ |
+
JsonValue |
+JsonObject.Member.getValue()
+Returns the value of this member.
+ |
+
static JsonValue |
+JsonValue.readFrom(Reader reader)
+Reads a JSON value from the given reader.
+ |
+
static JsonValue |
+JsonValue.readFrom(String text)
+Reads a JSON value from the given string.
+ |
+
static JsonValue |
+JsonValue.valueOf(boolean value)
+Returns a JsonValue instance that represents the given
+boolean value. |
+
static JsonValue |
+JsonValue.valueOf(double value)
+Returns a JsonValue instance that represents the given
+double value. |
+
static JsonValue |
+JsonValue.valueOf(float value)
+Returns a JsonValue instance that represents the given
+float value. |
+
static JsonValue |
+JsonValue.valueOf(int value)
+Returns a JsonValue instance that represents the given
+int value. |
+
static JsonValue |
+JsonValue.valueOf(long value)
+Returns a JsonValue instance that represents the given
+long value. |
+
static JsonValue |
+JsonValue.valueOf(String string)
+Returns a JsonValue instance that represents the given string.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
Iterator<JsonValue> |
+JsonArray.iterator()
+Returns an iterator over the values of this array in document order.
+ |
+
List<JsonValue> |
+JsonArray.values()
+Returns a list of the values in this array in document order.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
JsonArray |
+JsonArray.add(JsonValue value)
+Appends the specified JSON value to the end of this array.
+ |
+
JsonObject |
+JsonObject.add(String name,
+ JsonValue value)
+Appends a new member to the end of this object, with the specified name and the specified JSON
+ value.
+ |
+
JsonArray |
+JsonArray.set(int index,
+ JsonValue value)
+Replaces the element at the specified position in this array with the specified JSON value.
+ |
+
JsonObject |
+JsonObject.set(String name,
+ JsonValue value)
+Sets the value of the member with the specified name to the specified JSON value.
+ |
+
Class | +Description | +
---|---|
JsonArray | +
+ Represents a JSON array, i.e. an ordered collection of JSON values.
+ |
+
JsonObject | +
+ Represents a JSON object, i.e. an unordered set of name/value pairs, where the names are strings
+ and the values are JSON values.
+ |
+
JsonObject.Member | +
+ Represents a member of a JSON object, i.e. a pair of name and value.
+ |
+
JsonValue | +
+ Represents a JSON value.
+ |
+
Exception | +Description | +
---|---|
ParseException | +
+ An unchecked exception to indicate that an input does not qualify as valid JSON.
+ |
+
Package | +Description | +
---|---|
tk.cavariux.twitchirc.Json | ++ |
Class and Description | +
---|
JsonArray
+ Represents a JSON array, i.e. an ordered collection of JSON values.
+ |
+
JsonObject
+ Represents a JSON object, i.e. an unordered set of name/value pairs, where the names are strings
+ and the values are JSON values.
+ |
+
JsonObject.Member
+ Represents a member of a JSON object, i.e. a pair of name and value.
+ |
+
JsonValue
+ Represents a JSON value.
+ |
+