public abstract class GenericObject extends Object implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
protected static String |
AND |
protected static String |
AT |
protected static String |
COLON |
protected static String |
COMMA |
protected static String |
DOT |
protected static String |
DOUBLE_QUOTE |
protected static String |
EQUALS |
protected static String |
GREATER_THAN |
protected static String |
HT |
protected static Set<Class<?>> |
immutableClasses |
protected int |
indentation |
protected static String |
LESS_THAN |
protected static String |
LPAREN |
protected Match |
matchExpression |
protected static String |
NEWLINE |
protected static String |
PERCENT |
protected static String |
POUND |
protected static String |
QUESTION |
protected static String |
QUOTE |
protected static String |
RETURN |
protected static String |
RPAREN |
protected static String |
SEMICOLON |
protected static String |
SLASH |
protected static String |
SP |
protected static String |
STAR |
protected String |
stringRepresentation |
Modifier | Constructor and Description |
---|---|
protected |
GenericObject() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this object.
|
protected void |
dbgPrint()
Debug printing function.
|
protected void |
dbgPrint(String s)
Debug printing function.
|
String |
debugDump()
Generic print formatting function:
Does depth-first descent of the structure and
recursively prints all non-private objects pointed to
by this object.
|
String |
debugDump(int indent)
Formatter with a given starting indentation.
|
abstract String |
encode()
Get the string encoded version of this object
|
StringBuilder |
encode(StringBuilder buffer)
Put the encoded version of this object in the given StringBuilder.
|
boolean |
equals(Object that)
An introspection based equality predicate for GenericObjects.
|
static Class<?> |
getClassFromName(String className) |
protected String |
getIndentation() |
Match |
getMatcher()
Return the match expression.
|
static boolean |
isMySubclass(Class<?> other) |
static Object |
makeClone(Object obj)
Clones the given object.
|
boolean |
match(Object other)
An introspection based predicate matching using a template
object.
|
void |
merge(Object mergeObject)
Recursively override the fields of this object with the fields
of a new object.
|
void |
setMatcher(Match matchExpression)
Set the pattern matcher.
|
protected void |
sprint(boolean booleanField)
Pretty printing accumulator function for booleans
|
protected void |
sprint(char charField)
Pretty printing accumulator function for chars
|
protected void |
sprint(double doubleField)
Pretty printing accumulator function for doubles
|
protected void |
sprint(float floatField)
Pretty printing accumulator function for floats
|
protected void |
sprint(int intField)
Pretty printing accumulator function for ints
|
protected void |
sprint(long longField)
Pretty printing accumulator function for longs
|
protected void |
sprint(Object o)
Pretty printing function accumulator for objects.
|
protected void |
sprint(short shortField)
Pretty printing accumulator function for shorts
|
protected void |
sprint(String a)
Add a new string to the accumulated string representation.
|
protected static final String SEMICOLON
protected static final String COLON
protected static final String COMMA
protected static final String SLASH
protected static final String SP
protected static final String EQUALS
protected static final String STAR
protected static final String NEWLINE
protected static final String RETURN
protected static final String LESS_THAN
protected static final String GREATER_THAN
protected static final String AT
protected static final String DOT
protected static final String QUESTION
protected static final String POUND
protected static final String AND
protected static final String LPAREN
protected static final String RPAREN
protected static final String DOUBLE_QUOTE
protected static final String QUOTE
protected static final String HT
protected static final String PERCENT
protected int indentation
protected String stringRepresentation
protected Match matchExpression
public void setMatcher(Match matchExpression)
public Match getMatcher()
public static boolean isMySubclass(Class<?> other)
public static Object makeClone(Object obj)
public void merge(Object mergeObject)
mergeObject
- is the replacement object. The override
obect must be of the same class as this object.
Set any fields that you do not want to override as null in the
mergeOject object.protected String getIndentation()
protected void sprint(String a)
protected void sprint(Object o)
protected void sprint(int intField)
protected void sprint(short shortField)
protected void sprint(char charField)
protected void sprint(long longField)
protected void sprint(boolean booleanField)
protected void sprint(double doubleField)
protected void sprint(float floatField)
protected void dbgPrint()
protected void dbgPrint(String s)
public boolean equals(Object that)
public boolean match(Object other)
other
- the match pattern to test against. The match object
has to be of the same type (class). Primitive types
and non-sip fields that are non null are matched for equality.
Null in any field matches anything. Some book-keeping fields
are ignored when making the comparison.public String debugDump()
public String debugDump(int indent)
public abstract String encode()
public StringBuilder encode(StringBuilder buffer)
Copyright © 2015. All Rights Reserved.