public class Entity extends Object implements Serializable
Property}
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Date |
deployDate |
protected List<String> |
globalValidationErrors |
protected Boolean |
isActive |
protected Boolean |
isDeleted |
protected boolean |
isDirty |
protected Boolean |
isInactive |
protected boolean |
isPreAdd |
protected boolean |
isValidationFailure |
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 |
addGlobalValidationError(String errorOrErrorKey)
Adds a validation error to this entity that is not tied to any specific property.
|
void |
addGlobalValidationErrors(List<String> errorOrErrorKeys)
Similar to
addGlobalValidationError(String) except with a list of errors |
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() |
Date |
getDeployDate() |
List<String> |
getGlobalValidationErrors() |
Boolean |
getInactive() |
Map<String,Property> |
getPMap() |
Property[] |
getProperties() |
Map<String,List<String>> |
getPropertyValidationErrors()
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.
|
String[] |
getType() |
Map<String,List<String>> |
getValidationErrors()
Deprecated.
use
getPropertyValidationErrors() instead |
int |
hashCode() |
boolean |
isDirty() |
boolean |
isMultiPartAvailableOnThread() |
boolean |
isPreAdd() |
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.
|
Property |
removeProperty(String name) |
void |
setActive(Boolean active) |
void |
setDeleted(Boolean deleted) |
void |
setDeployDate(Date deployDate) |
void |
setDirty(boolean dirty) |
void |
setGlobalValidationErrors(List<String> globalValidationErrors) |
void |
setInactive(Boolean inactive) |
void |
setIsPreAdd(boolean isPreAdd) |
void |
setMultiPartAvailableOnThread(boolean multiPartAvailableOnThread) |
void |
setProperties(Property[] properties) |
void |
setPropertyValidationErrors(Map<String,List<String>> validationErrors)
Completely reset the validation errors for this Entity.
|
void |
setType(String[] type) |
void |
setValidationErrors(Map<String,List<String>> validationErrors)
Deprecated.
use
setPropertyValidationErrors(Map) instead |
void |
setValidationFailure(boolean validationFailure) |
String |
toString() |
protected static final long serialVersionUID
protected String[] type
protected Property[] properties
protected boolean isDirty
protected Date deployDate
protected Boolean isDeleted
protected Boolean isInactive
protected Boolean isActive
protected boolean multiPartAvailableOnThread
protected boolean isValidationFailure
protected boolean isPreAdd
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()
getPropertyValidationErrors()
map and
getGlobalValidationErrors()
if this boolean has not been explicitly setpublic void setValidationFailure(boolean validationFailure)
public boolean isPreAdd()
public void setIsPreAdd(boolean isPreAdd)
@Deprecated public Map<String,List<String>> getValidationErrors()
getPropertyValidationErrors()
insteadpublic Map<String,List<String>> getPropertyValidationErrors()
@Deprecated public void setValidationErrors(Map<String,List<String>> validationErrors)
setPropertyValidationErrors(Map)
insteadpublic void setPropertyValidationErrors(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 void addGlobalValidationError(String errorOrErrorKey)
addValidationError(String, String)
instead.errorOrErrorKey
- public void addGlobalValidationErrors(List<String> errorOrErrorKeys)
addGlobalValidationError(String)
except with a list of errorserrorOrErrorKeys
- public void setGlobalValidationErrors(List<String> globalValidationErrors)
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 Date getDeployDate()
public void setDeployDate(Date deployDate)
Copyright © 2022. All rights reserved.