Class ReportSummaryRow

java.lang.Object
com.onenetwork.platform.common.ReportSummaryRow
All Implemented Interfaces:
Model

public class ReportSummaryRow
extends java.lang.Object
Stub for ReportSummaryRow to compile platform-api code. This is removed from the platform-api jar, and at runtime the version from dvce.jar is used.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  ReportSummaryRow.SummaryCell
    Stub for ReportSummaryRow.SummaryCell
  • Constructor Summary

    Constructors 
    Constructor Description
    ReportSummaryRow()  
  • Method Summary

    Modifier and Type Method Description
    default void addWarning​(java.lang.String msgKey, java.lang.Object... args)
    Adds a Warning to the current model by instantiating a new StatusMessage with the given message, which can optionally be parameterized using MessageFormat and given arguments
    default java.util.List<Difference> diff​(Model m1, ModelDiffConfig cfg)
    Returns the differences found for field values in current Model and parameter Model object.
    default java.lang.Object getAttribute​(java.lang.String attributeName)
    Given a Attribute name, return the value of that Attribute.
    default StatusMessage getError()
    Returns the current Error set on this model
    default java.util.Calendar getLastModifiedDate()  
    default java.lang.String getLastModifiedUser()  
    default java.lang.Object getMDF​(java.lang.String modulePrefix, java.lang.String fieldName)
    Given a module prefix and module-defined field name, return the value of that MDF.
    default <T extends MDFs>
    T
    getMDFs​(java.lang.Class<T> moduleFieldsClass)  
    java.lang.String getName()  
    default <T extends Rider>
    T
    getRider​(java.lang.Class<T> cls)  
    default <T extends Rider>
    T
    getRider​(java.lang.Class<T> cls, PlatformUserContext pltUsrContext)  
    java.util.List<ReportSummaryRow.SummaryCell> getSummaryCell()  
    java.lang.String getSummaryHandler()  
    default java.lang.Long getSysId()
    Returns the surrogate key value for this Model.
    default java.lang.Object getTransientField​(java.lang.String key)
    Given the name of the transient field, this returns its corresponding value.
    default java.util.Map<java.lang.String,​java.lang.Object> getTransientFields()
    Returns a map of all transient fields and their values held in an instance.
    default java.lang.String getUdf​(java.lang.String name)
    Given a field name, returns the value of the User-Defined Field.
    default java.util.List<java.lang.String> getUdfNames()
    Returns a list of all User-Defined Field names which currently have values
    default java.util.List<StatusMessage> getWarnings()
    Contains a collection of "warning" messages which can be used to communicate informational, non-error conditions back to a client after a read operation.
    boolean isSetName()  
    boolean isSetSummaryHandler()  
    default void setAttribute​(java.lang.String attributeName, java.lang.Object value)
    Given a Attribute name and field value, sets that Attribute value on the model
    default void setError​(StatusMessage value)
    Sets the current Error for this model
    default void setError​(java.lang.String msgKey, java.lang.Object... args)
    Sets the current Error for this model by instantiating a new StatusMessage with the given message, which can optionally be parameterized using MessageFormat and given arguments
    default void setLastModifiedDate​(java.util.Calendar val)  
    default void setLastModifiedUser​(java.lang.String val)  
    default void setMDF​(java.lang.String modulePrefix, java.lang.String fieldName, java.lang.Object value)
    Given a module prefix, module-defined field name and field value, sets that MDF value on the model
    default void setSysId​(java.lang.Long sysId)
    Used by the Platform to populate the sysId of a Model from the database.
    default void setTransientField​(java.lang.String key, java.lang.Object val)
    Sets the value of the transient field given its name.
    default void setUdf​(java.lang.String name, java.lang.String value)
    Sets a User-Defined Field value
    default org.json.JSONObject toJSONObject()
    Returns a JSON representation of this Model.
    default org.json.JSONObject toJSONObject​(PlatformUserProfile profile)
    Returns a JSON representation of this Model.
    default org.json.JSONObject toJSONObjectExternal​(PlatformUserProfile profile)
    Returns a serialized JSON representation of this Model with following conditions.
    default org.json.JSONObject toJSONObjectFullySerialized​(PlatformUserProfile profile)
    Returns a fully serialized JSON representation of this Model.
    default java.lang.String toXML()
    Returns an XML representation of this Model.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.onenetwork.platform.data.model.Model

    equals
  • Constructor Details

  • Method Details

    • isSetName

      public boolean isSetName()
    • getName

      public java.lang.String getName()
    • getSummaryHandler

      public java.lang.String getSummaryHandler()
    • isSetSummaryHandler

      public boolean isSetSummaryHandler()
    • getSummaryCell

      public java.util.List<ReportSummaryRow.SummaryCell> getSummaryCell()
    • getSysId

      public default java.lang.Long getSysId()
      Description copied from interface: Model
      Returns the surrogate key value for this Model.
      Specified by:
      getSysId in interface Model
      Returns:
      surrogate key value for this Model
    • setSysId

      public default void setSysId​(java.lang.Long sysId)
      Description copied from interface: Model
      Used by the Platform to populate the sysId of a Model from the database. Not intended for user by clients.

      Please note that setting or changing this value will not have any effect on the surrogate key value in the database, either immediately or when the Model is written using an SPT action. However, if the surrogate value is provided it will be used to fetch the model's natural keys when executing a model write.

      Specified by:
      setSysId in interface Model
      Parameters:
      sysId - surrogate key value
    • getMDFs

      public default <T extends MDFs> T getMDFs​(java.lang.Class<T> moduleFieldsClass)
      Specified by:
      getMDFs in interface Model
      Type Parameters:
      T - ModuleFields class to retrieve instance of
      Parameters:
      moduleFieldsClass - ModuleFields class to retrieve instance of
      Returns:
      ModuleFields instance of given class from underlying jaxb
    • getError

      public default StatusMessage getError()
      Description copied from interface: Model
      Returns the current Error set on this model
      Specified by:
      getError in interface Model
    • setError

      public default void setError​(StatusMessage value)
      Description copied from interface: Model
      Sets the current Error for this model
      Specified by:
      setError in interface Model
      Parameters:
      value - error to set on this model
    • getWarnings

      public default java.util.List<StatusMessage> getWarnings()
      Description copied from interface: Model
      Contains a collection of "warning" messages which can be used to communicate informational, non-error conditions back to a client after a read operation.
      Specified by:
      getWarnings in interface Model
    • setError

      public default void setError​(java.lang.String msgKey, java.lang.Object... args)
      Description copied from interface: Model
      Sets the current Error for this model by instantiating a new StatusMessage with the given message, which can optionally be parameterized using MessageFormat and given arguments
      Specified by:
      setError in interface Model
      Parameters:
      msgKey - the key to the localized string. msgKey will be used as error message if no localized string is defined.
      args - parameters to error message if it is a pattern
    • addWarning

      public default void addWarning​(java.lang.String msgKey, java.lang.Object... args)
      Description copied from interface: Model
      Adds a Warning to the current model by instantiating a new StatusMessage with the given message, which can optionally be parameterized using MessageFormat and given arguments
      Specified by:
      addWarning in interface Model
      Parameters:
      msgKey - the key to the localized string. msgKey will be used as error message if no localized string is defined.
      args - parameters to error message if it is a pattern
    • getUdfNames

      public default java.util.List<java.lang.String> getUdfNames()
      Description copied from interface: Model
      Returns a list of all User-Defined Field names which currently have values
      Specified by:
      getUdfNames in interface Model
    • setUdf

      public default void setUdf​(java.lang.String name, java.lang.String value)
      Description copied from interface: Model
      Sets a User-Defined Field value
      Specified by:
      setUdf in interface Model
      Parameters:
      name - field name
      value - field value
    • getUdf

      public default java.lang.String getUdf​(java.lang.String name)
      Description copied from interface: Model
      Given a field name, returns the value of the User-Defined Field. may be null
      Specified by:
      getUdf in interface Model
      Parameters:
      name - field name
      Returns:
      field value
    • setMDF

      public default void setMDF​(java.lang.String modulePrefix, java.lang.String fieldName, java.lang.Object value)
      Description copied from interface: Model
      Given a module prefix, module-defined field name and field value, sets that MDF value on the model

      If the module is not available or the field name is not valid, this method throws a runtime exception.

      Usage:
      To set the MDF, here is an example:

       
           model.setMDF("PTA", "TestMDFForInteg", testCaseName);
       
      The first parameter is the module prefix, second one is the field name and the third parameter is the field value.

      Here are the examples to set different field types

        Double:             model.setMDF("PTA", "TestDouble", 100.0);
        Boolean:            model.setMDF("PTA", "TestBoolean", true);
        Address:            Address address = Services.get(AddressService.class).createAddress(CountryCodes.US);
                            address.set(AddressComponentType.STREET_1, testCaseName);
                            address.set(AddressComponentType.CITY, testCaseName);
                            address.set(AddressComponentType.STATE, "TX");
                            model.setMDF("PTA", "TestAddress", address);
        String Enumeration: model.setMDF("PTA", "TestStringEnum", "Test1");
        Integer:            model.setMDF("PTA", "TestInteger", 10);
        Float:              model.setMDF("PTA", "TestFloat", 10.0);
        Model Link: 
          Set the MDFs for individual components:    model.setMDF("PTA", "TestMLName", "SampleEnterprise");
        Composite: 
          Set the individuals fields of composite:   model.setMDF("PTA", "TestCompositeAmount", 100.00);
                                                     model.setMDF("PTA", "TestCompositeCurrency", CurrencyCode.USD.getValue());
       
      Specified by:
      setMDF in interface Model
      Parameters:
      modulePrefix - module prefix
      fieldName - module-defined field name
      value - new field value
    • getMDF

      public default java.lang.Object getMDF​(java.lang.String modulePrefix, java.lang.String fieldName)
      Description copied from interface: Model
      Given a module prefix and module-defined field name, return the value of that MDF.

      Usage:

       Object obj = model.getMDF("PTA", "TestFloat");
       
      (where PTA is the module prefix and TestFloat is the field name)

      This method throws a runtime exception if the module with the given prefix is not available during runtime or the field name is not valid.

      Specified by:
      getMDF in interface Model
      Parameters:
      modulePrefix - module prefix
      fieldName - module-defined field name
      Returns:
      the field value, or null if the field isn't found or has no value
    • getTransientFields

      public default java.util.Map<java.lang.String,​java.lang.Object> getTransientFields()
      Description copied from interface: Model
      Returns a map of all transient fields and their values held in an instance. Transient fields are part of an action, meaning they only live as long as the lifetime of the action they are used with.
      Specified by:
      getTransientFields in interface Model
    • getTransientField

      public default java.lang.Object getTransientField​(java.lang.String key)
      Description copied from interface: Model
      Given the name of the transient field, this returns its corresponding value.
      Specified by:
      getTransientField in interface Model
      Parameters:
      key - the name of the transient field
      Returns:
      the value of the field, or null if not found
    • setTransientField

      public default void setTransientField​(java.lang.String key, java.lang.Object val)
      Description copied from interface: Model
      Sets the value of the transient field given its name. If an entry with that name already exists, it will be overwritten with the new value.
      Specified by:
      setTransientField in interface Model
      Parameters:
      key - the name of the field
      val - the value of the field
    • toXML

      public default java.lang.String toXML()
      Description copied from interface: Model
      Returns an XML representation of this Model. See the XML Schema of your Model implementation for details. The XML will include any child levels. To convert XML to a Model, see XMLService.
      Specified by:
      toXML in interface Model
    • toJSONObject

      public default org.json.JSONObject toJSONObject()
      Description copied from interface: Model
      Returns a JSON representation of this Model. Will use system default for Date and other localized formats. Consider a model TestModel with ModelLinks for: Organization, TestModelLink and TransientField : "TestTransientField", using this method will result in following JSON conversion. Sample JSON received after conversion for TestModel:
            {
              "TestModelKey": "ModelKeyTest",
              "SysId": 9,
              "Organization": {
                "displayValue": "SouthRegion",
                "value": 10000
              },
              "ValueChainId": 100,
              "TestModelLink": {
                "displayValue": "ModelLinkTest",
                "value": 10001
              },
              "ModelLevelType": "PTA.TestModel",
              "TestTransientField": "TestVal"
            }
       
      To convert JSON to a Model, see JSONService.
      Specified by:
      toJSONObject in interface Model
    • toJSONObject

      public default org.json.JSONObject toJSONObject​(PlatformUserProfile profile)
      Description copied from interface: Model
      Returns a JSON representation of this Model. Will consult the given user profile for Date and other localized formats.
      Specified by:
      toJSONObject in interface Model
      Parameters:
      profile - user profile, from which localized date format and other information is taken
    • toJSONObjectFullySerialized

      public default org.json.JSONObject toJSONObjectFullySerialized​(PlatformUserProfile profile)
      Description copied from interface: Model
      Returns a fully serialized JSON representation of this Model. Will consult the given user profile for Date and other localized formats. Consider a model TestModel with ModelLinks for: Organization, TestModelLink and TransientField : "TestTransientField", using this method will result in following JSON conversion. Sample JSON received after conversion for TestModel:
       
          {
            "TestModelKey": "ModelKeyTest",
            "SysId": 9,
            "Organization": {
              "EnterpriseName": "ProgressiveRetailer",
              "value": 10000,
              "Name": "SouthRegion"
            },
            "ValueChainId": 100,
            "TestModelLink": {
              "TestModelKey": "ModelLinkTest",
              "value": 10001
            },
            "ModelLevelType": "PTA.TestModel",
            "TestTransientField": "TestVal"
          }
       
      Specified by:
      toJSONObjectFullySerialized in interface Model
      Parameters:
      profile - user profile, from which localized date format and other information is taken
    • toJSONObjectExternal

      public default org.json.JSONObject toJSONObjectExternal​(PlatformUserProfile profile)
      Description copied from interface: Model
      Returns a serialized JSON representation of this Model with following conditions. following conditions: serialize all NK components(populateAllNKComponents=true) serializeOnlyNKs = false, showsMDFSeparately, skipSysId and does not serialize transient fields on models. Will consult the given user profile for Date and other localized formats. Consider a model TestModel with ModelLinks for: Organization, TestModelLink and TransientField : "TestTransientField", using this method will result in following JSON conversion. Sample JSON received after conversion for TestModel:
          {
            "TestModelKey": "ModelKeyTest",
            "Organization": {
              "EnterpriseName": "ProgressiveRetailer",
              "Name": "SouthRegion"
            },
            "ValueChainId": 100,
            "TestModelLink": {
              "TestModelKey": "ModelLinkTest"
            },
            "ModelLevelType": "PTA.TestModel"
          }
       
      Specified by:
      toJSONObjectExternal in interface Model
      Parameters:
      profile - user profile, from which localized date format and other information is taken
    • diff

      public default java.util.List<Difference> diff​(Model m1, ModelDiffConfig cfg)
      Description copied from interface: Model
      Returns the differences found for field values in current Model and parameter Model object.

      Following list describes the type of value objects returned, if difference for specific field type is found,
      • Address Field Type: Model value class is Address
      • Composite Field Type (like DateRange, Monetary): Model value class is List. This list can contain heterogeneous primitive data types like Integer, String.
      • Duration Field Type: Model value class is String. e.g. "11D 11H 11M "
      • ModelLink Field Type: Model value class is ModelLinkKey. NOTE: Only natural key component values of ModelLink are compared.
      • String Enumeration Field Type: Model value class is String. e.g. for Currency, value can be INR
      • Primitive Field Type (like Integer, Float): Model value class is corresponding wrapper class from java.lang package
      Specified by:
      diff in interface Model
      Parameters:
      m1 - Model object to find differences
      cfg - rules to be used for diff
      Returns:
      list of differences found
      See Also:
      ModelDiffConfig, Difference
    • setAttribute

      public default void setAttribute​(java.lang.String attributeName, java.lang.Object value)
      Description copied from interface: Model
      Given a Attribute name and field value, sets that Attribute value on the model

      This method throws a runtime exception if provided attribute value is not valid

      Usage:
      To set the Attribute, here is an example:

       
           model.setAttribute("EPT.SampleEnterprise.TestString", "TestString");
       
      The first parameter is attribute field name and the second parameter is the field value.

      Here are the examples to set different field types

        Double:             model.setAttribute("EPT.SampleEnterprise.TestDouble", 100.0);
        Boolean:            model.setAttribute("EPT.SampleEnterprise.TestBoolean", true);
        Address:            Address address = Services.get(AddressService.class).createAddress(CountryCodes.US);
                            address.set(AddressComponentType.STREET_1, testCaseName);
                            address.set(AddressComponentType.CITY, testCaseName);
                            address.set(AddressComponentType.STATE, "TX");
                            model.setAttribute("EPT.SampleEnterprise.TestAddress", address);
        String Enumeration: model.setAttribute("EPT.SampleEnterprise.TestStringEnum", "Test1");
        Integer:            model.setAttribute("EPT.SampleEnterprise.TestInteger", 10);
        Float:              model.setAttribute("EPT.SampleEnterprise.TestFloat", 10.0);
        Duration:           DurationValue value = new DurationValue();
                            value.setValue("P1DT1H1M");
                            model.setAttribute("EPT.SampleEnterprise.TestDuration", value);
        Model Link: 
                            ModelLinkAttributeValue modelLinkAttributeValue = new ModelLinkAttributeValue();
          Set all the NK fields of ModelLink:       
                            modelLinkAttributeValue.set("EPT.SampleEnterprise.TestModelLinkName", "SampleEnterprise");           
                            //set the modellink field
                            model.setAttribute("EPT.SampleEnterprise.TestModelLink", modelLinkAttributeValue);
        Composite: 
          Set the individuals fields of composite:   
                            model.setAttribute("EPT.SampleEnterprise.TestCompositeAmount", 100.00);
                            model.setAttribute("EPT.SampleEnterprise.TestCompositeCurrency", CurrencyCode.USD.getValue());
       

      To nullify the attribute value, use NullConstants

        Double:             model.setAttribute("EPT.SampleEnterprise.TestDouble", NullConstants.NULL_DOUBLE_VALUE);
        Address:            model.setAttribute("EPT.SampleEnterprise.TestAddress", NullConstants.NULL_ADDRESS_VALUE);
        String Enumeration: model.setAttribute("EPT.SampleEnterprise.TestStringEnum", NullConstants.NULL_STRING_VALUE);
        Integer:            model.setAttribute("EPT.SampleEnterprise.TestInteger", NullConstants.NULL_INT_VALUE);
        Float:              model.setAttribute("EPT.SampleEnterprise.TestFloat", NullConstants.NULL_FLOAT_VALUE);
        Duration:           DurationValue value = new DurationValue();
                            value.setValue(NullConstants.NULL_STRING_VALUE);
                            model.setAttribute("EPT.SampleEnterprise.TestDuration", value);
        Model Link: 
                            ModelLinkAttributeValue modelLinkAttributeValue = new ModelLinkAttributeValue();
          Set the SysId to NULL Value:                
                            ModelLinkAttributeValue.setSysId(NullConstants.NULL_LONG_VALUE);  
                            model.setAttribute("EPT.SampleEnterprise.TestModelLink", modelLinkAttributeValue);
        Composite: 
          Nullify the individuals fields of composite:   
                            model.setAttribute("EPT.SampleEnterprise.TestCompositeAmount", NullConstants.NULL_DOUBLE_VALUE);
                            model.setAttribute("EPT.SampleEnterprise.TestCompositeCurrency", NullConstants.NULL_STRING_VALUE);
       
      Specified by:
      setAttribute in interface Model
      Parameters:
      attributeName - EPT defined attribute name
      value - new attribute value
    • getAttribute

      public default java.lang.Object getAttribute​(java.lang.String attributeName)
      Description copied from interface: Model
      Given a Attribute name, return the value of that Attribute.

      Usage:

       Object obj = model.getAttribute("EPT.ProgressiveRetailer.TestString");
       
      (EPT.ProgressiveRetailer.TestString is the attribute name)

      This method returns null if value is not exist for an attribute.

      Specified by:
      getAttribute in interface Model
      Parameters:
      attributeName - EPT defined attribute name
      Returns:
      attribute value
    • getRider

      public default <T extends Rider> T getRider​(java.lang.Class<T> cls, PlatformUserContext pltUsrContext)
      Specified by:
      getRider in interface Model
      Parameters:
      cls - Implementing class of Rider
      pltUsrContext - User Context
      Returns:
      Rider object associated with cls
    • getRider

      public default <T extends Rider> T getRider​(java.lang.Class<T> cls)
      Specified by:
      getRider in interface Model
      Parameters:
      cls - Implementing class of Rider
      Returns:
      Rider object associated with cls
    • getLastModifiedDate

      public default java.util.Calendar getLastModifiedDate()
      Specified by:
      getLastModifiedDate in interface Model
      Returns:
      Last date/time when the model was modified
    • getLastModifiedUser

      public default java.lang.String getLastModifiedUser()
      Specified by:
      getLastModifiedUser in interface Model
      Returns:
      username of the last user to modify the model
    • setLastModifiedDate

      public default void setLastModifiedDate​(java.util.Calendar val)
      Specified by:
      setLastModifiedDate in interface Model
      Parameters:
      val - last date/time when the model was modified
    • setLastModifiedUser

      public default void setLastModifiedUser​(java.lang.String val)
      Specified by:
      setLastModifiedUser in interface Model
      Parameters:
      val - username of the last user to modify the model