Class ClassifierSupport<C,T>

java.lang.Object
org.springframework.classify.ClassifierSupport<C,T>
Type Parameters:
C - the type of the thing to classify
T - the output of the classifier
All Implemented Interfaces:
Serializable, Classifier<C,T>

public class ClassifierSupport<C,T> extends Object implements Classifier<C,T>
Base class for Classifier implementations. Provides default behaviour and some convenience members, like constants.
Author:
Dave Syer
See Also:
  • Constructor Details

    • ClassifierSupport

      public ClassifierSupport(T defaultValue)
      Parameters:
      defaultValue - the default value
  • Method Details

    • classify

      public T classify(C throwable)
      Always returns the default value. This is the main extension point for subclasses, so it must be able to classify null.
      Specified by:
      classify in interface Classifier<C,T>
      Parameters:
      throwable - the input object. Can be null.
      Returns:
      an object. Can be null, but implementations should declare if this is the case.
      See Also: