Class ContainsPredicate
java.lang.Object
com.gigaspaces.internal.serialization.AbstractExternalizable
com.gigaspaces.internal.query.predicate.AbstractSpacePredicate
com.gigaspaces.internal.query.predicate.comparison.ScalarSpacePredicate
com.gigaspaces.internal.query.predicate.comparison.ContainsPredicate
- All Implemented Interfaces:
ISpacePredicate,SmartExternalizable,Externalizable,Serializable
- Direct Known Subclasses:
ContainsItemPredicate
Represents a contains predicate. This predicate returns true if and only if the predicate's
argument is a collection and contains the expected value.
- Since:
- 8.0
- Author:
- Anna Pavtulov, Idan Moyal
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected short[]protected Stringprotected SpacePropertyInfo[]protected ISpacePredicateprotected shortprotected String[]Fields inherited from class com.gigaspaces.internal.query.predicate.comparison.ScalarSpacePredicate
_convertedValueWrapper, _expectedValue, functionCallDescription -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for Externalizable.ContainsPredicate(Object expectedValue, FunctionCallDescription functionCallDescription, String fieldPath, short templateMatchCode) ContainsPredicate(Object expectedValue, FunctionCallDescription functionCallDescription, String fieldPath, short templateMatchCode, String relation, String typeName) -
Method Summary
Modifier and TypeMethodDescriptionbooleanIterate through the the field's path tokens and when reached to a collection, iterate through its items for property matching (collection[*].property = ?) or call match for regular contains (collection[*] = ?).protected booleanexecutePredicate(Object valueToMatch) Performs a single value matching.protected short[]protected Stringprotected Stringprotected Stringprotected ObjectgetPreparedExpectedValue(Object target) Since we don't know the generic type of the collection we try to get it from the first matching attempt target.protected SpacePropertyInfo[]protected String[]protected voidprotected booleanprotected booleanperformMatching(Object value, int tokenIndex, int currentContainsIndex) protected voidvoidsetCacheManagerForExecution(CacheManager cacheManager) protected voidMethods inherited from class com.gigaspaces.internal.query.predicate.comparison.ScalarSpacePredicate
equals, getExpectedValue, toStringMethods inherited from class com.gigaspaces.internal.query.predicate.AbstractSpacePredicate
preparePredicate, requiresCacheManagerForExecutionMethods inherited from class com.gigaspaces.internal.serialization.AbstractExternalizable
readExternal, writeExternalMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.io.Externalizable
readExternal, writeExternalMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Field Details
-
_tokens
-
_propertyInfo
-
_spacePredicate
-
_fieldPath
-
_containsIndexes
protected short[] _containsIndexes -
_templateMatchCode
protected short _templateMatchCode
-
-
Constructor Details
-
ContainsPredicate
public ContainsPredicate()Default constructor for Externalizable. -
ContainsPredicate
public ContainsPredicate(Object expectedValue, FunctionCallDescription functionCallDescription, String fieldPath, short templateMatchCode) -
ContainsPredicate
public ContainsPredicate(Object expectedValue, FunctionCallDescription functionCallDescription, String fieldPath, short templateMatchCode, String relation, String typeName)
-
-
Method Details
-
match
- Specified by:
matchin classScalarSpacePredicate
-
setCacheManagerForExecution
- Specified by:
setCacheManagerForExecutionin interfaceISpacePredicate- Overrides:
setCacheManagerForExecutionin classAbstractSpacePredicate
-
getOperatorName
- Specified by:
getOperatorNamein classScalarSpacePredicate
-
getPreparedExpectedValue
Since we don't know the generic type of the collection we try to get it from the first matching attempt target.- Overrides:
getPreparedExpectedValuein classScalarSpacePredicate
-
execute
Iterate through the the field's path tokens and when reached to a collection, iterate through its items for property matching (collection[*].property = ?) or call match for regular contains (collection[*] = ?). The target object should be of ServerEntry type which is passed from the relevant Range object.- Specified by:
executein interfaceISpacePredicate- Overrides:
executein classScalarSpacePredicate- Returns:
- True if the specified target matches the predicate, false otherwise.
-
initialize
protected void initialize() -
performMatching
-
executePredicate
Performs a single value matching. Initializes the appropriate space predicate for matching if necessary. -
getFieldPath
-
getTokens
-
getContainsIndexes
protected short[] getContainsIndexes() -
getPropertyInfo
-
getContainsPath
-
readExternalImpl
- Overrides:
readExternalImplin classScalarSpacePredicate- Throws:
IOExceptionClassNotFoundException
-
writeExternalImpl
- Overrides:
writeExternalImplin classScalarSpacePredicate- Throws:
IOException
-