Package jadex.commons

Class ConstantFilter<T>

  • All Implemented Interfaces:
    IFilter<T>

    public class ConstantFilter<T>
    extends java.lang.Object
    implements IFilter<T>
    Filter with fixed return value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean value
      The return value.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantFilter()
      Create filter instance.
      ConstantFilter​(boolean value)
      Create filter instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Is equal?
      boolean filter​(T obj)
      Test if an object passes the filter.
      int hashCode()
      Hash code.
      boolean isValue()
      Get the value.
      void setValue​(boolean value)
      Set the value.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • value

        protected boolean value
        The return value.
    • Constructor Detail

      • ConstantFilter

        public ConstantFilter()
        Create filter instance.
      • ConstantFilter

        public ConstantFilter​(boolean value)
        Create filter instance.
    • Method Detail

      • filter

        public boolean filter​(T obj)
        Test if an object passes the filter.
        Specified by:
        filter in interface IFilter<T>
        Returns:
        True, if passes the filter.
      • isValue

        public boolean isValue()
        Get the value.
        Returns:
        the value.
      • setValue

        public void setValue​(boolean value)
        Set the value.
        Parameters:
        value - The value to set.
      • equals

        public boolean equals​(java.lang.Object obj)
        Is equal?
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Hash code.
        Overrides:
        hashCode in class java.lang.Object