Class AttributeConfig

java.lang.Object
com.hazelcast.config.AttributeConfig
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class AttributeConfig 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:
  • Constructor Details

    • AttributeConfig

      public AttributeConfig()
      Creates an empty AttributeConfig.
    • AttributeConfig

      public AttributeConfig(String name, String extractorClassName)
      Creates a AttributeConfig 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
      extractorClassName - full class name of the extractor used to extract the value of the attribute
      See Also:
    • AttributeConfig

      public AttributeConfig(AttributeConfig config)
  • Method Details

    • 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

      public AttributeConfig 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 AttributeConfig
      Throws:
      IllegalArgumentException - if attribute is null,an empty or inappropriate string
      See Also:
    • getExtractorClassName

      public String getExtractorClassName()
      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:
    • setExtractorClassName

      public AttributeConfig setExtractorClassName(String extractorClassName)
      Sets the full class name of the extractor in a String format, e.g. com.example.car.SpeedExtractor.
      Parameters:
      extractorClassName - the full class name of the extractor in a String format
      Returns:
      the updated AttributeConfig
    • 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
    • getClassId

      public int getClassId()
      Description copied from interface: IdentifiedDataSerializable
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
      getClassId 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