Class ViewRequest<T extends Model>
java.lang.Object
com.onenetwork.platform.data.model.ViewRequest<T>
public class ViewRequest<T extends Model>
extends java.lang.Object
Encapsulates all parameters which go into invoking a Model view programmatically.
-
Constructor Summary
Constructors Constructor Description ViewRequest(java.lang.Class<T> modelLevelClass, java.lang.String viewName)
Constructs a ViewRequest, assuming that the model queries will be "Standard [ModelType]".ViewRequest(java.lang.Class<T> modelLevelClass, java.lang.String viewName, java.lang.String customModelName)
Constructs a ViewRequest for a view on a particular custom model from the SPT. -
Method Summary
Modifier and Type Method Description void
addFilter(java.lang.Class<? extends Model> level, java.lang.String fieldName, java.lang.Object value)
Adds a filter value to be used when invoking the view.java.lang.String
getCustomModelName()
Returns the custom model name from the SPTjava.util.Map<FieldId,java.lang.Object>
getFilters()
Contains all filter values to be used to invoke the view; can be mutated by the clientjava.lang.Class<T>
getModelLevelClass()
Returns the top-level class for the model being queriedjava.lang.String
getViewName()
Returns the name of the view being invokedboolean
isConcurrencyVersionRetrieval()
Method to check if concurrencyVersionRetrieval is set for current view request.boolean
isSetConcurrencyVersionRetrieval()
void
setConcurrencyVersionRetrieval(boolean concurrencyRetrieval)
Method to set the concurrencyVersionRetrieval flag in viewRequest so that concurrencyVersion transient field will be set on the models requested in view.void
setCustomModelName(java.lang.String customModelName)
Sets the custom model name from the SPTvoid
setModelLevelClass(java.lang.Class<T> modelLevelClass)
Sets the top-level class for the model being queriedvoid
setViewName(java.lang.String viewName)
Sets the name of the view being invoked
-
Constructor Details
-
ViewRequest
Constructs a ViewRequest, assuming that the model queries will be "Standard [ModelType]".- Parameters:
modelLevelClass
- top-level class of the model being queried in the viewviewName
- name of the view being invoked
-
ViewRequest
public ViewRequest(java.lang.Class<T> modelLevelClass, java.lang.String viewName, java.lang.String customModelName)Constructs a ViewRequest for a view on a particular custom model from the SPT.- Parameters:
modelLevelClass
- top-level class of the model being queried in the viewcustomModelName
- custom model name from the SPTviewName
- name of the view being invoked
-
-
Method Details
-
getViewName
public java.lang.String getViewName()Returns the name of the view being invoked -
getCustomModelName
public java.lang.String getCustomModelName()Returns the custom model name from the SPT -
getModelLevelClass
Returns the top-level class for the model being queried -
setModelLevelClass
Sets the top-level class for the model being queried -
setCustomModelName
public void setCustomModelName(java.lang.String customModelName)Sets the custom model name from the SPT -
setViewName
public void setViewName(java.lang.String viewName)Sets the name of the view being invoked -
addFilter
public void addFilter(java.lang.Class<? extends Model> level, java.lang.String fieldName, java.lang.Object value)Adds a filter value to be used when invoking the view. The expected java object for each filter field type is:FieldType Java Object BOOLEAN Boolean DATE DateRange
DOUBLE Double FLOAT Float HYPERLINK String INTEGER Integer LONG Long MODEL_LINK ModelLinkKey
STATE String STRING String STRING_ENUMERATION String List
of values of the given type for any FieldType.- Parameters:
level
- model class describing the level on which the filter field is definedfieldName
- name of the field within the levelvalue
- filter value
-
getFilters
Contains all filter values to be used to invoke the view; can be mutated by the client -
isConcurrencyVersionRetrieval
public boolean isConcurrencyVersionRetrieval()Method to check if concurrencyVersionRetrieval is set for current view request. If set, concurrencyVersion transient field will be set on the model being queried in view request.- Returns:
- true if concurrencyVersionRetrieval is set, false if not.
-
isSetConcurrencyVersionRetrieval
public boolean isSetConcurrencyVersionRetrieval() -
setConcurrencyVersionRetrieval
public void setConcurrencyVersionRetrieval(boolean concurrencyRetrieval)Method to set the concurrencyVersionRetrieval flag in viewRequest so that concurrencyVersion transient field will be set on the models requested in view.- Parameters:
concurrencyRetrieval
-
-