public abstract class APIParam<PARAMOBJ>
extends java.lang.Object
implements java.lang.Comparable<PARAMOBJ>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
ivHashCode
The object's hash code.
|
protected java.lang.String[] |
ivHashFlds
The object's set of hash code field names.
|
protected org.json.JSONObject |
ivObjFlds
The object's field names and values.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Modifier | Constructor and Description |
---|---|
protected |
APIParam()
A constructor for the abstract object.
|
protected |
APIParam(java.util.HashMap<java.lang.String,java.lang.Object> source)
A constructor for the abstract object.
|
protected |
APIParam(java.util.HashMap<java.lang.String,java.lang.Object> source,
java.lang.String[] hashflds)
A constructor for the abstract object.
|
protected |
APIParam(java.lang.String source)
A constructor for the abstract object.
|
protected |
APIParam(java.lang.String source,
java.lang.String[] hashflds)
A constructor for the abstract object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
after(PARAMOBJ obj)
Answers if this object is greater than the given object based on the
object's
compareTo method results. |
boolean |
before(PARAMOBJ obj)
Answers if this object is less than the given object based on the
object's
compareTo method results. |
int |
compareTo(PARAMOBJ obj)
Compares this object to the given object and determines if this object is
less than, equal to or greater than the given object.
|
boolean |
equals(java.lang.Object obj)
Compares the given object to this object and determines if the two are
equal.
|
java.lang.String[] |
getHashFields()
Returns this object's set of hash code field names.
|
org.json.JSONObject |
getObjectFields()
Returns this object's field names and values.
|
int |
hashCode()
Returns a hash code for this object based on the field names supplied
on the constructor.
|
protected void |
removeStringWhitespace()
Removes whitespace from this object's string values.
|
protected abstract void |
removeUnwantedFields()
Removes unwanted fields from a JSON object or from an array of JSON objects.
|
protected void |
removeUnwantedFields(java.lang.String arrname,
java.lang.String[] fldnames)
Removes unwanted fields from a JSON object or from an array of JSON objects.
|
void |
setHashFields(java.lang.String[] hashFlds)
Sets this object's set of hash code field names.
|
void |
setObjectFields(org.json.JSONObject flds)
Sets this object's field names and values.
|
java.lang.String |
toJSONString()
Returns a JSON formatted string of this object's fields and values.
|
java.lang.String |
toString()
Returns a JSON formatted string of this object's fields and values.
|
private static final long serialVersionUID
protected org.json.JSONObject ivObjFlds
protected java.lang.String[] ivHashFlds
protected int ivHashCode
protected APIParam()
null
. The object's hash code is zero.protected APIParam(java.util.HashMap<java.lang.String,java.lang.Object> source)
source
- (HashMap) A hash map of field names and values.protected APIParam(java.util.HashMap<java.lang.String,java.lang.Object> source, java.lang.String[] hashflds)
source
- (HashMap) A hash map of field names and values.hashflds
- (String[]) The set of field names used to determine
the object's hash code. If no fields names are supplied, the
object's hash code is zero.protected APIParam(java.lang.String source)
source
- (String) A string beginning with {
(left brace) and ending with }
(right brace).protected APIParam(java.lang.String source, java.lang.String[] hashflds)
source
- (String) A string beginning with {
(left brace) and ending with }
(right brace).hashflds
- (String[]) The set of field names used to determine
the object's hash code. If no fields names are supplied, the
object's hash code is zero.public int compareTo(PARAMOBJ obj)
compareTo
in interface java.lang.Comparable<PARAMOBJ>
obj
- (PARAMOBJ) The object to compare with this object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- (Object) The object to compare with this object.true
if the specified object is equal to
this object, otherwise false
.public int hashCode()
hashCode
in class java.lang.Object
public boolean after(PARAMOBJ obj)
compareTo
method results.obj
- (PARAMOBJ) The object to compare to this object to.true
if this object is greater than the given
object, otherwise false
.public boolean before(PARAMOBJ obj)
compareTo
method results.obj
- (PARAMOBJ) The object to compare to this object to.true
if this object is less than the given
object, otherwise false
.public java.lang.String[] getHashFields()
public void setHashFields(java.lang.String[] hashFlds)
hashFlds
- (String[]) The hash code field names.public org.json.JSONObject getObjectFields()
public void setObjectFields(org.json.JSONObject flds)
flds
- (JSONObject) The field names and values.public java.lang.String toJSONString()
toString()
method.public java.lang.String toString()
toJSONString()
method.toString
in class java.lang.Object
protected void removeStringWhitespace()
protected void removeUnwantedFields(java.lang.String arrname, java.lang.String[] fldnames)
arrname
- (String) The name of an array of objects or null
if processing a top-level object.fldnames
- (String[]) An array of field names to removeprotected abstract void removeUnwantedFields()