public abstract class AbstractUpdatableResource<R extends BaseResource> extends Object
Modifier and Type | Field and Description |
---|---|
protected R |
model |
protected ObjectFactory |
OBJECT_FACTORY |
protected static String[] |
STRICTLY_IMMUTABLE |
Constructor and Description |
---|
AbstractUpdatableResource(String id) |
Modifier and Type | Method and Description |
---|---|
protected String[] |
addStrictlyImmutable(String... fields) |
String |
getId() |
protected String[] |
getStrictlyImmutable()
Override this method if any additional resource-specific fields are
strictly immutable
|
protected R |
newModel()
Create a new instance of the resource
|
protected void |
refresh()
Refresh the current model state for update validity checking.
|
void |
setId(String id) |
protected void |
validateUpdate(R incoming)
Validate update from an immutability point of view.
|
protected static final String[] STRICTLY_IMMUTABLE
protected final ObjectFactory OBJECT_FACTORY
protected final R extends BaseResource model
public AbstractUpdatableResource(String id)
protected R newModel()
protected void validateUpdate(R incoming)
incoming
- the incoming resource representationexisting
- the existing resource representationWebApplicationException
- wrapping an appropriate response
iff an immutability constraint has been brokenpublic void setId(String id)
public String getId()
protected String[] getStrictlyImmutable()
protected void refresh()
Copyright © 2012. All Rights Reserved.