Class AttributesFilter
java.lang.Object
com.emc.documentum.rest.dfc.conversion.AttributesFilter
Filter the attributes for a target object
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends PersistentObject>
Tfilter
(T object, com.documentum.fc.client.IDfPersistentObject targetObject, List<String> skipAttributes, boolean validateUnknown) Filter out attributes that should be skipped or ignored; The attributes will be removed from PersistentObject.static <T extends PersistentObject>
Tfilter
(T object, com.documentum.fc.client.IDfPersistentObject targetObject, List<String> skipAttributes, boolean validateUnknown, boolean ignoreUnmodified) Filter out attributes that should be skipped or ignored; The attributes will be removed from PersistentObject.protected static boolean
ignorableForUnknown
(String attrName, com.documentum.fc.client.IDfPersistentObject targetObject, boolean validateUnknown) Check ifattrName
is unknown attribute for targetObject, then decide whether to ignore it.protected static boolean
ignorableForUnmodified
(Attribute<?> attribute, com.documentum.fc.client.IDfPersistentObject targetObject, boolean checkUnmodified) Check ifattribute
is unmodified attribute for targetObject, then decide whether to ignore it.protected static boolean
Checks ifattrName
should be skipped.
-
Method Details
-
filter
public static <T extends PersistentObject> T filter(T object, com.documentum.fc.client.IDfPersistentObject targetObject, List<String> skipAttributes, boolean validateUnknown) throws com.documentum.fc.common.DfException Filter out attributes that should be skipped or ignored; The attributes will be removed from PersistentObject.- Type Parameters:
T
- the PersistentObject or its subclass- Parameters:
object
- The PersistentObject to be filteredtargetObject
- The corresponding DFC objectskipAttributes
- A list of attribute names to skipvalidateUnknown
- Indicate if to ignore unknown attribute names- Returns:
- The PersistentObject with filtered attributes removed
- Throws:
com.documentum.fc.common.DfException
- exception during the operation
-
filter
public static <T extends PersistentObject> T filter(T object, com.documentum.fc.client.IDfPersistentObject targetObject, List<String> skipAttributes, boolean validateUnknown, boolean ignoreUnmodified) throws com.documentum.fc.common.DfException Filter out attributes that should be skipped or ignored; The attributes will be removed from PersistentObject.- Type Parameters:
T
- the PersistentObject or its subclass- Parameters:
object
- The PersistentObject to be filteredtargetObject
- The corresponding DFC objectskipAttributes
- A list of attribute names to skipvalidateUnknown
- Indicate if to validate unknown attribute names; true to validate; false to ignoreignoreUnmodified
- Indicate if to ignore value-not-modified attributes; iftrue
, server compare all attribute values and ignores attributes that their values are not changed; iffalse
, server enforces to update all attributes in the request body regardless of their values; true to filter out read-only attributes if the value are not changed; false to no check.- Returns:
- The PersistentObject with filtered attributes removed
- Throws:
com.documentum.fc.common.DfException
- exception during the operation
-
skippable
Checks ifattrName
should be skipped. Leverage this method to customize attributes filter.- Parameters:
attrName
- attribute to checkskipAttributes
- collection of attributes to skip- Returns:
true
if attrName should be skipped.
-
ignorableForUnknown
protected static boolean ignorableForUnknown(String attrName, com.documentum.fc.client.IDfPersistentObject targetObject, boolean validateUnknown) throws com.documentum.fc.common.DfException Check ifattrName
is unknown attribute for targetObject, then decide whether to ignore it. Leverage this method to customize attributes filter- Parameters:
attrName
- attribute to checktargetObject
- target object which hasattrName
or notvalidateUnknown
-true
to validate unknown attribute fortargetObject
- Returns:
false
ifattrName
is known attribute oftargetObject
true
ifattrName
is unknown attribute oftargetObject
andvalidateUnknown
isfalse
- Throws:
com.documentum.fc.common.DfException
- ifattrName
is unknown attribute oftargetObject
andvalidateUnknown
istrue
-
ignorableForUnmodified
protected static boolean ignorableForUnmodified(Attribute<?> attribute, com.documentum.fc.client.IDfPersistentObject targetObject, boolean checkUnmodified) throws com.documentum.fc.common.DfException Check ifattribute
is unmodified attribute for targetObject, then decide whether to ignore it. Leverage this method to customize attributes filter.- Parameters:
attribute
- attribute to checktargetObject
- target object which has same attribute withattribute
or notcheckUnmodified
-true
to check ifattribute
is unmodified attribute oftargetObject
- Returns:
false
ifcheckUnmodified
isfalse
ortargetObject
has dirty data orattribute
is not unmodified fortargetObject
true
ifcheckUnmodified
istrue
andtargetObject
has dirty data andattribute
is unmodified fortargetObject
- Throws:
com.documentum.fc.common.DfException
- the exception during the operation
-