public abstract class AbstractContext extends Object implements Serializable
AbstractContext
is a generic context class. It has two fields: name and userObject. The name is just the
name of the context. You can use a meaningful string to name it. The userObject is customizable portion of Context.
You can set whatever you want as userObject. It's just a convention between whoever set it and whoever use it. For
example, in ConverterContext
, we sometimes used it to pass in a Format
.Constructor and Description |
---|
AbstractContext(String name)
Creates a named
AbstractContext . |
AbstractContext(String name,
Object object)
Creates an abstract context with a name and an object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Override equals.
|
String |
getName()
Gets the name of the abstract context.
|
Object |
getUserObject()
Gets the user object.
|
int |
hashCode() |
void |
setName(String name)
Sets the name of the abstract context.
|
void |
setUserObject(Object userObject)
Sets the user object.
|
String |
toString() |
public AbstractContext(String name)
AbstractContext
.name
- the name of the AbstractContext
.public String getName()
public void setName(String name)
name
- the name of the abstract contextpublic Object getUserObject()
public void setUserObject(Object userObject)
userObject
- the user object.public boolean equals(Object o)