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 SPT
    java.util.Map<FieldId,​java.lang.Object> getFilters()
    Contains all filter values to be used to invoke the view; can be mutated by the client
    java.lang.Class<T> getModelLevelClass()
    Returns the top-level class for the model being queried
    java.lang.String getViewName()
    Returns the name of the view being invoked
    boolean 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 SPT
    void setModelLevelClass​(java.lang.Class<T> modelLevelClass)
    Sets the top-level class for the model being queried
    void setViewName​(java.lang.String viewName)
    Sets the name of the view being invoked

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ViewRequest

      public ViewRequest​(java.lang.Class<T> modelLevelClass, java.lang.String viewName)
      Constructs a ViewRequest, assuming that the model queries will be "Standard [ModelType]".
      Parameters:
      modelLevelClass - top-level class of the model being queried in the view
      viewName - 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 view
      customModelName - custom model name from the SPT
      viewName - 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

      public java.lang.Class<T> getModelLevelClass()
      Returns the top-level class for the model being queried
    • setModelLevelClass

      public void setModelLevelClass​(java.lang.Class<T> modelLevelClass)
      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:

      FieldTypeJava Object
      BOOLEANBoolean
      DATEDateRange
      DOUBLEDouble
      FLOATFloat
      HYPERLINKString
      INTEGERInteger
      LONGLong
      MODEL_LINKModelLinkKey
      STATEString
      STRINGString
      STRING_ENUMERATIONString
      You can also pass a List of values of the given type for any FieldType.
      Parameters:
      level - model class describing the level on which the filter field is defined
      fieldName - name of the field within the level
      value - filter value
    • getFilters

      public java.util.Map<FieldId,​java.lang.Object> 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 -