Package com.onenetwork.platform.common
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 usingMessageFormat
and given argumentsdefault 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 aAttribute
name, return the value of that Attribute.default StatusMessage
getError()
Returns the current Error set on this modeldefault 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>
TgetMDFs(java.lang.Class<T> moduleFieldsClass)
java.lang.String
getName()
default <T extends Rider>
TgetRider(java.lang.Class<T> cls)
default <T extends Rider>
TgetRider(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 valuesdefault 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 aAttribute
name and field value, sets that Attribute value on the modeldefault void
setError(StatusMessage value)
Sets the current Error for this modeldefault 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 usingMessageFormat
and given argumentsdefault 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 modeldefault 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 valuedefault 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.
-
Constructor Details
-
ReportSummaryRow
public ReportSummaryRow()
-
-
Method Details
-
isSetName
public boolean isSetName() -
getName
public java.lang.String getName() -
getSummaryHandler
public java.lang.String getSummaryHandler() -
isSetSummaryHandler
public boolean isSetSummaryHandler() -
getSummaryCell
-
getSysId
public default java.lang.Long getSysId()Description copied from interface:Model
Returns the 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. -
getMDFs
-
getError
Description copied from interface:Model
Returns the current Error set on this model -
setError
Description copied from interface:Model
Sets the current Error for this model -
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 interfaceModel
-
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 usingMessageFormat
and given arguments -
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 usingMessageFormat
and given arguments- Specified by:
addWarning
in interfaceModel
- 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 interfaceModel
-
setUdf
public default void setUdf(java.lang.String name, java.lang.String value)Description copied from interface:Model
Sets a User-Defined 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 -
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 typesDouble: 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());
-
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. -
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 interfaceModel
-
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 interfaceModel
- 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 interfaceModel
- Parameters:
key
- the name of the fieldval
- 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, seeXMLService
. -
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, seeJSONService
.- Specified by:
toJSONObject
in interfaceModel
-
toJSONObject
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 interfaceModel
- Parameters:
profile
- user profile, from which localized date format and other information is taken
-
toJSONObjectFullySerialized
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 interfaceModel
- Parameters:
profile
- user profile, from which localized date format and other information is taken
-
toJSONObjectExternal
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 interfaceModel
- Parameters:
profile
- user profile, from which localized date format and other information is taken
-
diff
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 beINR
- Primitive Field Type (like Integer, Float): Model value class is corresponding wrapper class from
java.lang
package
- Specified by:
diff
in interfaceModel
- Parameters:
m1
- Model object to find differencescfg
- rules to be used for diff- Returns:
- list of differences found
- See Also:
ModelDiffConfig
,Difference
- Address Field Type: Model value class is
-
setAttribute
public default void setAttribute(java.lang.String attributeName, java.lang.Object value)Description copied from interface:Model
Given aAttribute
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 typesDouble: 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, useNullConstants
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 interfaceModel
- Parameters:
attributeName
- EPT defined attribute namevalue
- new attribute value
-
getAttribute
public default java.lang.Object getAttribute(java.lang.String attributeName)Description copied from interface:Model
Given aAttribute
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 interfaceModel
- Parameters:
attributeName
- EPT defined attribute name- Returns:
- attribute value
-
getRider
public default <T extends Rider> T getRider(java.lang.Class<T> cls, PlatformUserContext pltUsrContext) -
getRider
-
getLastModifiedDate
public default java.util.Calendar getLastModifiedDate()- Specified by:
getLastModifiedDate
in interfaceModel
- Returns:
- Last date/time when the model was modified
-
getLastModifiedUser
public default java.lang.String getLastModifiedUser()- Specified by:
getLastModifiedUser
in interfaceModel
- Returns:
- username of the last user to modify the model
-
setLastModifiedDate
public default void setLastModifiedDate(java.util.Calendar val)- Specified by:
setLastModifiedDate
in interfaceModel
- Parameters:
val
- last date/time when the model was modified
-
setLastModifiedUser
public default void setLastModifiedUser(java.lang.String val)- Specified by:
setLastModifiedUser
in interfaceModel
- Parameters:
val
- username of the last user to modify the model
-