Class PredicateConfig

    • Field Detail

      • className

        protected java.lang.String className
      • sql

        protected java.lang.String sql
      • implementation

        protected Predicate implementation
    • Constructor Detail

      • PredicateConfig

        public PredicateConfig()
        Creates a PredicateConfig without className/implementation.
      • PredicateConfig

        public PredicateConfig​(java.lang.String className)
        Creates a PredicateConfig with the given className.
        Parameters:
        className - the name of the Predicate class
        Throws:
        java.lang.IllegalArgumentException - if className is null or an empty String
      • PredicateConfig

        public PredicateConfig​(Predicate implementation)
        Creates a PredicateConfig with the given implementation.
        Parameters:
        implementation - the implementation to use as Predicate
        Throws:
        java.lang.IllegalArgumentException - if the implementation is null
    • Method Detail

      • getClassName

        public java.lang.String getClassName()
        Returns the name of the class of the Predicate. If no class is specified, null is returned.
        Returns:
        the class name of the Predicate
        See Also:
        setClassName(String)
      • setClassName

        public PredicateConfig setClassName​(java.lang.String className)
        Sets the class name of the Predicate.

        If a implementation or sql was set, it will be removed.

        Parameters:
        className - the name of the class of the Predicate
        Returns:
        the updated PredicateConfig
        Throws:
        java.lang.IllegalArgumentException - if className is null or an empty String
        See Also:
        setImplementation(Predicate), getClassName()
      • getImplementation

        public Predicate getImplementation()
        Returns the Predicate implementation. If none has been specified, null is returned.
        Returns:
        the Predicate implementation
        See Also:
        setImplementation(Predicate)
      • setImplementation

        public PredicateConfig setImplementation​(Predicate implementation)
        Sets the Predicate implementation.

        If a className or sql was set, it will be removed.

        Parameters:
        implementation - the Predicate implementation
        Returns:
        the updated PredicateConfig
        Throws:
        java.lang.IllegalArgumentException - the implementation is null
        See Also:
        setClassName(String), getImplementation()
      • getSql

        public java.lang.String getSql()
        Returns sql string for this config.
        Returns:
        sql string for this config
      • setSql

        public PredicateConfig setSql​(java.lang.String sql)
        Sets sql string for this config.

        If a className or implementation was set, it will be removed.

        Parameters:
        sql - sql string for this config
        Returns:
        this configuration
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeData

        public void writeData​(ObjectDataOutput out)
                       throws java.io.IOException
        Description copied from interface: DataSerializable
        Writes object fields to output stream
        Specified by:
        writeData in interface DataSerializable
        Parameters:
        out - output
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
      • readData

        public void readData​(ObjectDataInput in)
                      throws java.io.IOException
        Description copied from interface: DataSerializable
        Reads fields from the input stream
        Specified by:
        readData in interface DataSerializable
        Parameters:
        in - input
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.