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 booleanignorableForUnknown(String attrName, com.documentum.fc.client.IDfPersistentObject targetObject, boolean validateUnknown) Check ifattrNameis unknown attribute for targetObject, then decide whether to ignore it.protected static booleanignorableForUnmodified(Attribute<?> attribute, com.documentum.fc.client.IDfPersistentObject targetObject, boolean checkUnmodified) Check ifattributeis unmodified attribute for targetObject, then decide whether to ignore it.protected static booleanChecks ifattrNameshould 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 ifattrNameshould be skipped. Leverage this method to customize attributes filter.- Parameters:
attrName- attribute to checkskipAttributes- collection of attributes to skip- Returns:
trueif 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 ifattrNameis 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 hasattrNameor notvalidateUnknown-trueto validate unknown attribute fortargetObject- Returns:
falseifattrNameis known attribute oftargetObject
trueifattrNameis unknown attribute oftargetObjectandvalidateUnknownisfalse- Throws:
com.documentum.fc.common.DfException- ifattrNameis unknown attribute oftargetObjectandvalidateUnknownistrue
-
ignorableForUnmodified
protected static boolean ignorableForUnmodified(Attribute<?> attribute, com.documentum.fc.client.IDfPersistentObject targetObject, boolean checkUnmodified) throws com.documentum.fc.common.DfException Check ifattributeis 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 withattributeor notcheckUnmodified-trueto check ifattributeis unmodified attribute oftargetObject- Returns:
falseifcheckUnmodifiedisfalseortargetObjecthas dirty data orattributeis not unmodified fortargetObject
trueifcheckUnmodifiedistrueandtargetObjecthas dirty data andattributeis unmodified fortargetObject- Throws:
com.documentum.fc.common.DfException- the exception during the operation
-