com.hazelcast.config

## Class MapAttributeConfig

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

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable
  Direct Known Subclasses:
    MapAttributeConfigReadOnly

      public class MapAttributeConfig
      extends Object
      implements IdentifiedDataSerializable

  Contains the configuration of a custom attribute that will be extracted from a Map's entry using a given ValueExtractor. This class should be used in combination with the `MapConfig`.
  See Also:
    `ValueExtractor`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapAttributeConfig()` Creates an empty MapAttributeConfig.
    `MapAttributeConfig(MapAttributeConfig config)`
    `MapAttributeConfig(String name, String extractor)` Creates a MapAttributeConfig with the given attribute and ordered setting.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `MapAttributeConfigReadOnly` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `String` | `getExtractor()` Gets the full class name of the extractor in a String format, e.g.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `String` | `getName()` Gets the name of the attribute extracted by the extractor.
    `int` | `hashCode()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `MapAttributeConfig` | `setExtractor(String extractor)` Sets the full class name of the extractor in a String format, e.g.
    `MapAttributeConfig` | `setName(String name)` Sets the name of the attribute extracted by the extractor.
    `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`

- - ### Constructor Detail

    - #### MapAttributeConfig

          public MapAttributeConfig()

      Creates an empty MapAttributeConfig.

    - #### MapAttributeConfig

          public MapAttributeConfig(String name,
                                    String extractor)

      Creates a MapAttributeConfig with the given attribute and ordered setting.

      Name may begin with an ascii letter [A-Za-z] or digit [0-9] and may contain ascii letters [A-Za-z], digits [0-9] or underscores later on.

      Parameters:
        `name` - the name given to an attribute that is going to be extracted
        `extractor` - full class name of the extractor used to extract the value of the attribute
      See Also:
        `setName(String)`, `setExtractor(String)`

    - #### MapAttributeConfig

          public MapAttributeConfig(MapAttributeConfig config)

  - ### Method Detail

    - #### getAsReadOnly

          public MapAttributeConfigReadOnly 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

    - #### getName

          public String getName()

      Gets the name of the attribute extracted by the extractor.
      Returns:
        the name of the attribute extracted by the extractor
      See Also:
        `setName(String)`

    - #### setName

          public MapAttributeConfig setName(String name)

      Sets the name of the attribute extracted by the extractor. The name cannot be equal to any of the query constants.
      Parameters:
        `name` - the name of the attribute extracted by the extractor
      Returns:
        the updated MapAttributeConfig
      Throws:
        `IllegalArgumentException` - if attribute is null,an empty or inappropriate string
      See Also:
        `QueryConstants`

    - #### getExtractor

          public String getExtractor()

      Gets the full class name of the extractor in a String format, e.g. `com.example.car.SpeedExtractor`.
      Returns:
        the full class name of the extractor in a String format
      See Also:
        `setExtractor(String)`

    - #### setExtractor

          public MapAttributeConfig setExtractor(String extractor)

      Sets the full class name of the extractor in a String format, e.g. `com.example.car.SpeedExtractor`.
      Parameters:
        `extractor` - the full class name of the extractor in a String format
      Returns:
        the updated MapAttributeConfig

    - #### 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.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2020. All rights reserved.