public class Entity extends Object implements Serializable
Property}
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Boolean |
isActive |
protected Boolean |
isDeleted |
protected boolean |
isDirty |
protected Boolean |
isInactive |
protected Boolean |
isLocked |
protected boolean |
isValidationFailure |
protected String |
lockedBy |
protected String |
lockedDate |
protected boolean |
multiPartAvailableOnThread |
protected Map<String,Property> |
pMap |
protected Property[] |
properties |
protected static long |
serialVersionUID |
protected String[] |
type |
protected Map<String,List<String>> |
validationErrors |
Constructor and Description |
---|
Entity() |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(Property property) |
void |
addValidationError(String fieldName,
String errorOrErrorKey)
Adds a single validation error to this entity.
|
boolean |
equals(Object o) |
Property |
findProperty(String name) |
Boolean |
getActive() |
Boolean |
getDeleted() |
Boolean |
getInactive() |
Boolean |
getLocked() |
String |
getLockedBy() |
String |
getLockedDate() |
Map<String,Property> |
getPMap() |
Property[] |
getProperties() |
String[] |
getType() |
Map<String,List<String>> |
getValidationErrors()
Validation error map where the key corresponds to the property that failed validation (which could be dot-separated)
and the value corresponds to a list of the error messages, in the case of multiple errors on the same field.
|
int |
hashCode() |
boolean |
isDirty() |
boolean |
isMultiPartAvailableOnThread() |
boolean |
isValidationFailure() |
void |
mergeProperties(String prefix,
Entity entity) |
void |
overridePropertyValues(Entity entity)
Replaces all property values in this entity with the values from the given entity.
|
void |
setActive(Boolean active) |
void |
setDeleted(Boolean deleted) |
void |
setDirty(boolean dirty) |
void |
setInactive(Boolean inactive) |
void |
setLocked(Boolean locked) |
void |
setLockedBy(String lockedBy) |
void |
setLockedDate(String lockedDate) |
void |
setMultiPartAvailableOnThread(boolean multiPartAvailableOnThread) |
void |
setProperties(Property[] properties) |
void |
setType(String[] type) |
void |
setValidationErrors(Map<String,List<String>> validationErrors)
Completely reset the validation errors for this Entity.
|
void |
setValidationFailure(boolean validationFailure) |
protected static final long serialVersionUID
protected String[] type
protected Property[] properties
protected boolean isDirty
protected Boolean isDeleted
protected Boolean isInactive
protected Boolean isActive
protected Boolean isLocked
protected String lockedBy
protected String lockedDate
protected boolean multiPartAvailableOnThread
protected boolean isValidationFailure
public String[] getType()
public void setType(String[] type)
public Property[] getProperties()
public void setProperties(Property[] properties)
public void overridePropertyValues(Entity entity)
pMap
entity
- public void addProperty(Property property)
public void addValidationError(String fieldName, String errorOrErrorKey)
setValidationFailure(boolean)
.fieldName
- - the field that is in error. This works on top-level properties (like a 'manufacturer' field on a
Product entity) but can also work on properties gleaned from a related entity (like
'defaultSku.weight.weightUnitOfMeasure' on a Product entity)errorOrErrorKey
- - the error message to present to a user. Could be the actual error message or a key to a
property in messages.properties to support different localespublic boolean isDirty()
public void setDirty(boolean dirty)
public boolean isMultiPartAvailableOnThread()
public void setMultiPartAvailableOnThread(boolean multiPartAvailableOnThread)
public boolean isValidationFailure()
getValidationErrors()
map if this
boolean has not been explicitly setpublic void setValidationFailure(boolean validationFailure)
public Map<String,List<String>> getValidationErrors()
public void setValidationErrors(Map<String,List<String>> validationErrors)
addValidationError(String, String)
. This will also set the entire
entity in an error state by invoking setValidationFailure(boolean)
.validationErrors
- addValidationError(String, String)
public Boolean getActive()
public void setActive(Boolean active)
public Boolean getDeleted()
public void setDeleted(Boolean deleted)
public Boolean getInactive()
public void setInactive(Boolean inactive)
public Boolean getLocked()
public void setLocked(Boolean locked)
public String getLockedBy()
public void setLockedBy(String lockedBy)
public String getLockedDate()
public void setLockedDate(String lockedDate)
Copyright © 2014. All rights reserved.