public abstract class QueryFunction
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
QueryFilter
or QueryConfig
, not
this class directly. Other than that, simply pay attention to the abstract methods in this class and your toString()
implementation.QueryFilter
,
QueryConfig
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_PROPERTY |
static java.lang.String |
VIEWKEY_PROPERTY |
Modifier | Constructor and Description |
---|---|
protected |
QueryFunction() |
Modifier and Type | Method and Description |
---|---|
abstract void |
applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.types.Request query,
java.lang.String stateName)
Apply this function to a Request.
|
void |
applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.types.Request query,
java.lang.String stateName,
javax.portlet.PortletRequest request) |
void |
beforeQueryStateAdd(QueryState state)
Function to check for any additional conditions when adding to the query state.
|
void |
beforeQueryStateRemove(QueryState state) |
QueryFunction |
clone() |
boolean |
equals(java.lang.Object other) |
boolean |
equals(QueryFunction other)
Compares two QueryFunction instances by checking class types and using the object's toString() method
|
java.lang.String |
getCompareString()
Return the compare string of QueryFunctions instance the default value get from toString method.
|
java.lang.String |
getName()
Retrieve the name.
|
java.lang.String |
getStateNameOverride() |
long |
getVersion()
Retrieve the version.
|
java.lang.String |
getViewKey()
Indicates the view against which this function applies.
|
int |
hashCode() |
void |
initializeFromJSON(MDEXState mdexState)
This method is called when constructing a MDEXState's initialQueryState from a json object.
|
boolean |
isInvalid() |
void |
setInvalid(boolean invalid) |
void |
setName(java.lang.String name)
Set the name.
|
void |
setStateNameOverride(java.lang.String stateNameOverride) |
void |
setVersion(long version)
Set the version.
|
void |
setViewKey(java.lang.String viewKey)
Sets the view against which this function applies.
|
abstract java.lang.String |
toString()
This class' toString is abstract: all concrete subclasses are expected to provide an implementation. toString is used in comparing
QueryFunction instances for equality, so if you implement a QueryFunction subclass it is important that your toString implementation be
consistent and deterministic.
|
QueryFunction |
upgrade()
Upgrade the query function in the case of an upgrade.
|
public static final java.lang.String CLASS_PROPERTY
public static final java.lang.String VIEWKEY_PROPERTY
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic java.lang.String getViewKey()
public void setViewKey(java.lang.String viewKey)
the
- view keypublic java.lang.String getStateNameOverride()
public void setStateNameOverride(java.lang.String stateNameOverride)
public long getVersion()
public void setVersion(long version)
version
- the version to setpublic QueryFunction upgrade()
public abstract void applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.types.Request query, java.lang.String stateName) throws QueryFunctionUnsupportedException
query
- the CS Request to which this function should be appliedstateName
- stateName to use for filters or content element configsQueryFunctionUnsupportedException
public void applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.types.Request query, java.lang.String stateName, javax.portlet.PortletRequest request) throws QueryFunctionUnsupportedException
public abstract java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getCompareString()
public QueryFunction clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean equals(QueryFunction other)
other
- QueryFunction
equals the otherpublic int hashCode()
hashCode
in class java.lang.Object
public void beforeQueryStateAdd(QueryState state)
public void beforeQueryStateRemove(QueryState state)
public void initializeFromJSON(MDEXState mdexState) throws QueryFunctionInitializationException
ArbitraryLQLASTFilter
classes use this technique
to allow different params/member vars for initialization from json vs. initialization programmatically from within Java.mdexState
- the MDEXState object on which this QueryFunction existsQueryFunctionInitializationException
public boolean isInvalid()
public void setInvalid(boolean invalid)
Copyright 2003, 2014, Oracle and/or its affiliates. All rights reserved.