public abstract class VdmObject<ObjectT> extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
changedOriginalFields |
Constructor and Description |
---|
VdmObject() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
protected void |
fromMap(Map<String,Object> values) |
Map<String,Object> |
getChangedFields()
Returns map of all fields which have been changed on this entity along with their updated values.
|
<FieldT> FieldT |
getCustomField(EntityField<ObjectT,FieldT> customField)
This method allows for retrieval of custom fields that are added to the underlying OData services.
|
<FieldT> FieldT |
getCustomField(String customFieldName)
This method allows for retrieval of custom fields that are added to the underlying OData services.
|
Set<String> |
getCustomFieldNames() |
Map<String,Object> |
getCustomFields() |
protected Map<String,Object> |
getKey() |
protected Set<String> |
getSetOfCustomFields() |
protected Set<String> |
getSetOfFields() |
protected Set<String> |
getSetOfNavigationProperties() |
abstract Class<ObjectT> |
getType() |
boolean |
hasCustomField(EntityField<ObjectT,?> customField) |
boolean |
hasCustomField(String customFieldName) |
int |
hashCode() |
protected void |
rememberChangedField(String fieldName,
Object valueBeforeChange)
Remembers the original value of a changed field.
|
void |
resetChangedFields()
Resets the map of all fields which have been changed on this entity.
|
<FieldT> void |
setCustomField(EntityField<ObjectT,FieldT> customField,
FieldT value)
Sets the value of a single custom field.
|
void |
setCustomField(String customFieldName,
Object value)
Sets the value of a single custom field.
|
protected Map<String,Object> |
toMap() |
protected Map<String,Object> |
toMapOfCustomFields() |
protected Map<String,Object> |
toMapOfFields() |
protected Map<String,Object> |
toMapOfNavigationProperties() |
String |
toString() |
public Set<String> getCustomFieldNames()
@Nonnull public Map<String,Object> getCustomFields()
public void setCustomField(@Nonnull String customFieldName, @Nullable Object value)
customFieldName
- Name of the custom field.value
- Value of the custom field.public <FieldT> void setCustomField(@Nonnull EntityField<ObjectT,FieldT> customField, @Nullable FieldT value)
customField
- Name of the custom field, represented as an EntityField object.value
- Value of the custom field.public boolean hasCustomField(@Nonnull String customFieldName)
customFieldName
- Name of the custom field to check fortrue
if this entity has a custom field with the given name, false
otherwise.public boolean hasCustomField(@Nonnull EntityField<ObjectT,?> customField)
customField
- Custom field to check for, represented as an EntityField
object.true
if this object has a custom field with the name of the given field, false
otherwise.@Nullable public <FieldT> FieldT getCustomField(@Nonnull String customFieldName) throws NoSuchEntityFieldException
customFieldName
- Name of the field returned by the underlying OData service.NoSuchEntityFieldException
@Nullable public <FieldT> FieldT getCustomField(@Nonnull EntityField<ObjectT,FieldT> customField) throws NoSuchEntityFieldException
customField
- Field returned by the underlying OData service.NoSuchEntityFieldException
@Nonnull public Map<String,Object> getChangedFields()
protected void rememberChangedField(@Nonnull String fieldName, @Nullable Object valueBeforeChange)
fieldName
- The name of the field that is changed.valueBeforeChange
- The original value before the change.public void resetChangedFields()
After calling this method, no field is considered changed, until you change the value of fields on this entity afterwards.
protected boolean canEqual(Object other)
Copyright © 2018 SAP SE. All rights reserved.