Package com.hazelcast.config
Class AttributeConfig
- java.lang.Object
-
- com.hazelcast.config.AttributeConfig
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class AttributeConfig extends java.lang.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 theMapConfig
.- See Also:
ValueExtractor
-
-
Constructor Summary
Constructors Constructor Description AttributeConfig()
Creates an empty AttributeConfig.AttributeConfig(AttributeConfig config)
AttributeConfig(java.lang.String name, java.lang.String extractorClassName)
Creates a AttributeConfig with the given attribute and ordered setting.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getClassId()
Returns type identifier for this class.java.lang.String
getExtractorClassName()
Gets the full class name of the extractor in a String format, e.g.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.java.lang.String
getName()
Gets the name of the attribute extracted by the extractor.int
hashCode()
void
readData(ObjectDataInput in)
Reads fields from the input streamAttributeConfig
setExtractorClassName(java.lang.String extractorClassName)
Sets the full class name of the extractor in a String format, e.g.AttributeConfig
setName(java.lang.String name)
Sets the name of the attribute extracted by the extractor.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Constructor Detail
-
AttributeConfig
public AttributeConfig()
Creates an empty AttributeConfig.
-
AttributeConfig
public AttributeConfig(java.lang.String name, java.lang.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 extractedextractorClassName
- full class name of the extractor used to extract the value of the attribute- See Also:
setName(String)
,(String)
-
AttributeConfig
public AttributeConfig(AttributeConfig config)
-
-
Method Detail
-
getName
public java.lang.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 AttributeConfig setName(java.lang.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:
java.lang.IllegalArgumentException
- if attribute is null,an empty or inappropriate string- See Also:
QueryConstants
-
getExtractorClassName
public java.lang.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:
(String)
-
setExtractorClassName
public AttributeConfig setExtractorClassName(java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFactoryId
public int getFactoryId()
Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- 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 interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
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 interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
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 interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-