Package org.kordamp.json
Class JSONFunction
- java.lang.Object
-
- org.kordamp.json.JSONFunction
-
- All Implemented Interfaces:
java.io.Serializable
public class JSONFunction extends java.lang.Object implements java.io.Serializable
JSONFunction represents a javaScript function's text.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
EMPTY_PARAM_ARRAY
constant array for empty parametersprivate java.lang.String[]
params
the parameters of this functionprivate static long
serialVersionUID
private java.lang.String
text
the text of this function
-
Constructor Summary
Constructors Constructor Description JSONFunction(java.lang.String text)
Constructs a JSONFunction with no parameters.JSONFunction(java.lang.String[] params, java.lang.String text)
Constructs a JSONFunction with parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String[]
getParams()
Returns the parameters of this function.java.lang.String
getText()
Reeturns the text of this function.int
hashCode()
static JSONFunction
parse(java.lang.String str)
Constructs a JSONFunction from a text representationjava.lang.String
toString()
Returns the string representation of this function.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
EMPTY_PARAM_ARRAY
private static final java.lang.String[] EMPTY_PARAM_ARRAY
constant array for empty parameters
-
params
private java.lang.String[] params
the parameters of this function
-
text
private java.lang.String text
the text of this function
-
-
Constructor Detail
-
JSONFunction
public JSONFunction(java.lang.String text)
Constructs a JSONFunction with no parameters.- Parameters:
text
- The text of the function
-
JSONFunction
public JSONFunction(java.lang.String[] params, java.lang.String text)
Constructs a JSONFunction with parameters.- Parameters:
params
- The parameters of the functiontext
- The text of the function
-
-
Method Detail
-
parse
public static JSONFunction parse(java.lang.String str)
Constructs a JSONFunction from a text representation
-
getParams
public java.lang.String[] getParams()
Returns the parameters of this function.
-
getText
public java.lang.String getText()
Reeturns the text of this function.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns the string representation of this function.- Overrides:
toString
in classjava.lang.Object
-
-