com.hazelcast.config

## Class PredicateConfig

- java.lang.Object
- - com.hazelcast.config.PredicateConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public class PredicateConfig
      extends Object
      implements IdentifiedDataSerializable

  Contains the configuration for an `Predicate`. The configuration contains either the class name of the Predicate implementation, or the actual Predicate instance.
  Since:
    3.5

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `className`
    `protected Predicate` | `implementation`
    `protected String` | `sql`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PredicateConfig()` Creates a PredicateConfig without className/implementation.
    `PredicateConfig(Predicate implementation)` Creates a PredicateConfig with the given implementation.
    `PredicateConfig(PredicateConfig config)`
    `PredicateConfig(String className)` Creates a PredicateConfig with the given className.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `PredicateConfig` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `String` | `getClassName()` Returns the name of the class of the Predicate.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `Predicate` | `getImplementation()` Returns the Predicate implementation.
    `String` | `getSql()` Returns sql string for this config.
    `int` | `hashCode()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `PredicateConfig` | `setClassName(String className)` Sets the class name of the Predicate.
    `PredicateConfig` | `setImplementation(Predicate implementation)` Sets the Predicate implementation.
    `void` | `setSql(String sql)` Sets sql string for this config.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### className

          protected String className

    - #### sql

          protected String sql

    - #### implementation

          protected Predicate implementation

  - ### Constructor Detail

    - #### PredicateConfig

          public PredicateConfig()

      Creates a PredicateConfig without className/implementation.

    - #### PredicateConfig

          public PredicateConfig(String className)

      Creates a PredicateConfig with the given className.
      Parameters:
        `className` - the name of the Predicate class
      Throws:
        `IllegalArgumentException` - if className is `null` or an empty String

    - #### PredicateConfig

          public PredicateConfig(PredicateConfig config)

    - #### PredicateConfig

          public PredicateConfig(Predicate implementation)

      Creates a PredicateConfig with the given implementation.
      Parameters:
        `implementation` - the implementation to use as Predicate
      Throws:
        `IllegalArgumentException` - if the implementation is `null`

  - ### Method Detail

    - #### getAsReadOnly

          public PredicateConfig getAsReadOnly()

      Deprecated. this method will be removed in 4.0; it is meant for internal usage only
      Gets immutable version of this configuration.
      Returns:
        immutable version of this configuration

    - #### getClassName

          public 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(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:
        `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:
        `IllegalArgumentException` - the implementation is `null`
      See Also:
        `setClassName(String)`, `getImplementation()`

    - #### getSql

          public String getSql()

      Returns sql string for this config.
      Returns:
        sql string for this config

    - #### setSql

          public void setSql(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

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `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 IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

Copyright © 2019. All rights reserved.