Class ConstraintFormatter

java.lang.Object
org.moeaframework.util.format.ConstraintFormatter
All Implemented Interfaces:
Formatter<Constraint>

public class ConstraintFormatter extends Object implements Formatter<Constraint>
Formatter for Constraints. Primarily, this uses the registered formatter, if any, for numeric types.
  • Constructor Details

    • ConstraintFormatter

      public ConstraintFormatter(TabularData<?> data)
      Constructs a new constraint formatter.
      Parameters:
      data - reference back to the tabular data object this formatter is associated, so it can call the TabularData.formatValue(Object) method on primitive types
  • Method Details

    • getType

      public Class<Constraint> getType()
      Description copied from interface: Formatter
      Returns the class (or classes using inheritance) this formatter supports.
      Specified by:
      getType in interface Formatter<Constraint>
      Returns:
      the class
    • format

      public String format(Object value)
      Description copied from interface: Formatter
      Formats the given value into a string representation.
      Specified by:
      format in interface Formatter<Constraint>
      Parameters:
      value - the value
      Returns:
      the string representation