public interface Message
Message
s can be used to pass additional information along with the response.
Some clients such as Fiori UIs provide controls to show these messages in a user friendly way.Modifier and Type | Interface and Description |
---|---|
static class |
Message.Severity
Severity levels.
|
Modifier and Type | Method and Description |
---|---|
Message |
code(String code)
Adds the passed
code to the current message. |
String |
getCode()
The optional code of the message
|
String |
getLongTextUrl()
The optional long text url
|
String |
getMessage()
The localized message
|
Message.Severity |
getSeverity()
The severity of the message.
|
MessageTarget |
getTarget()
The optional
MessageTarget |
Message |
longTextUrl(String longTextUrl)
Adds the passed
longTextUrl to the current message. |
<E extends com.sap.cds.ql.StructuredType<E>> |
target(Class<E> entity,
Function<E,Object> path)
Adds the passed root entity and CQN path as target to the current
Message . |
Message |
target(String target)
Sets the provided string-based target.
|
<E extends com.sap.cds.ql.StructuredType<E>> |
target(String prefix,
Class<E> entity,
Function<E,Object> path)
Adds the passed root entity and CQN path as target to the current
Message . |
Message |
target(String entity,
Function<com.sap.cds.ql.StructuredType<?>,Object> path)
Adds the passed root entity and CQN path as target to the current
Message . |
Message |
target(String prefix,
String entity,
Function<com.sap.cds.ql.StructuredType<?>,Object> path)
Adds the passed root entity and CQN path as target to the current
Message . |
String getCode()
String getMessage()
MessageTarget getTarget()
MessageTarget
MessageTarget
String getLongTextUrl()
Message.Severity getSeverity()
Message longTextUrl(String longTextUrl)
longTextUrl
to the current message.longTextUrl
- The long text url to be setMessage code(String code)
code
to the current message.code
- The code to be setMessage target(String target)
target
- the string-based targetMessage target(String entity, Function<com.sap.cds.ql.StructuredType<?>,Object> path)
Message
.entity
- the root entity of the pathpath
- the path to the target element or associationMessage target(String prefix, String entity, Function<com.sap.cds.ql.StructuredType<?>,Object> path)
Message
.prefix
- the string-based prefix, prepended to the CQN pathentity
- the root entity of the pathpath
- the path to the target element or association<E extends com.sap.cds.ql.StructuredType<E>> Message target(Class<E> entity, Function<E,Object> path)
Message
.E
- the entity typeentity
- the root entity of the pathpath
- the path to the target element or association<E extends com.sap.cds.ql.StructuredType<E>> Message target(String prefix, Class<E> entity, Function<E,Object> path)
Message
.E
- the entity typeprefix
- the string-based prefix, prepended to the CQN pathentity
- the root entity of the pathpath
- the path to the target element or associationCopyright © 2020. All rights reserved.