@Validated public class NodeRpc extends ChangeableRpc<Node,Long>
Node
entity.Modifier and Type | Class and Description |
---|---|
static class |
NodeRpc.ChangeCallback
Execution callback used to update entity.
|
static class |
NodeRpc.NodeRpcConverter
|
Modifier | Constructor and Description |
---|---|
protected |
NodeRpc() |
|
NodeRpc(Node entity)
|
Modifier and Type | Method and Description |
---|---|
protected MutableNode |
createEntityInstance(Map<String,?> params)
Creates new entity instance from RPC.
|
String |
getCode() |
String |
getDescription() |
String |
getName() |
String |
getState() |
void |
preSaveValidation(org.springframework.validation.BindingResult errors,
Node updateEntity)
Validates RPC (mandatory attributes, correct object state etc.).
|
void |
setDescription(String description) |
void |
setName(String name) |
void |
setState(String state) |
String |
toString() |
protected void |
updateAttributes(Node param,
boolean created)
Updates attributes of specified entity from RPC values.
|
protected void |
validate(org.springframework.validation.BindingResult errors,
Node updateEntity)
Validates RPC (mandatory attributes, correct object state etc.).
|
createBeanPropertyBindingResult, createEntity, createEntity, createEntity, getObjectName, updateEntity, updateEntity
protected NodeRpc()
public NodeRpc(Node entity)
entity
- of nodeprotected void validate(org.springframework.validation.BindingResult errors, @Nullable Node updateEntity) throws ValidationException
ChangeableRpc
There are the following possibilities how to make validation:
errors
(e.g. use ValidationUtils
).
If it has errors then InputValidationException
will be thrown
ValidationException
itself (e.g. use Constraints
for asserts)
ValidationException
then
original exception will be wrapped by IllegalDataException
validate
in class ChangeableRpc<Node,Long>
errors
- Binding/validation errorsupdateEntity
- null
if new entity is created otherwise entity that is updatedValidationException
- when there is error in input datapublic final void preSaveValidation(org.springframework.validation.BindingResult errors, @Nullable Node updateEntity) throws ValidationException
errors
- Binding/validation errorsupdateEntity
- null
if new entity is created otherwise entity that is updatedValidationException
- when there is error in input dataprotected MutableNode createEntityInstance(Map<String,?> params)
ChangeableRpc
createEntityInstance
in class ChangeableRpc<Node,Long>
params
- Input parameters from client for creating new instanceprotected void updateAttributes(Node param, boolean created)
ChangeableRpc
updateAttributes
in class ChangeableRpc<Node,Long>
param
- The entitycreated
- true
if new entity is created or false
if entity is updatedpublic String getCode()
public String getName()
public void setName(String name)
public void setDescription(String description)
public String getState()
public void setState(String state)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.