Class AbstractContext

java.lang.Object
com.jidesoft.converter.AbstractContext
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ComparatorContext, ConverterContext, GrouperContext

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.
See Also:
  • Constructor Details

    • AbstractContext

      public AbstractContext(String name)
      Creates a named AbstractContext.
      Parameters:
      name - the name of the AbstractContext.
    • AbstractContext

      public AbstractContext(String name, Object object)
      Creates an abstract context with a name and an object.
      Parameters:
      name - the name of the AbstractContext.
      object - the user object. It can be used any object to pass information along.
  • Method Details

    • getName

      public String getName()
      Gets the name of the abstract context.
      Returns:
      the name of the abstract context
    • setName

      public void setName(String name)
      Sets the name of the abstract context.
      Parameters:
      name - the name of the abstract context
    • getUserObject

      public Object getUserObject()
      Gets the user object.
      Returns:
      the user object
    • setUserObject

      public void setUserObject(Object userObject)
      Sets the user object.
      Parameters:
      userObject - the user object.
    • equals

      public boolean equals(Object o)
      Override equals. Two abstract context equals as long as the name is the same.
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare.
      Returns:
      if two objects equal.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object