Class AttributesFilter

java.lang.Object
com.emc.documentum.rest.dfc.conversion.AttributesFilter

public class AttributesFilter extends Object
Filter the attributes for a target object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends PersistentObject>
    T
    filter(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>
    T
    filter(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 if attrName 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 if attribute is unmodified attribute for targetObject, then decide whether to ignore it.
    protected static boolean
    skippable(String attrName, List<String> skipAttributes)
    Checks if attrName should be skipped.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 filtered
      targetObject - The corresponding DFC object
      skipAttributes - A list of attribute names to skip
      validateUnknown - 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 filtered
      targetObject - The corresponding DFC object
      skipAttributes - A list of attribute names to skip
      validateUnknown - Indicate if to validate unknown attribute names; true to validate; false to ignore
      ignoreUnmodified - Indicate if to ignore value-not-modified attributes; if true, server compare all attribute values and ignores attributes that their values are not changed; if false, 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

      protected static boolean skippable(String attrName, List<String> skipAttributes)
      Checks if attrName should be skipped. Leverage this method to customize attributes filter.
      Parameters:
      attrName - attribute to check
      skipAttributes - 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 if attrName is unknown attribute for targetObject, then decide whether to ignore it. Leverage this method to customize attributes filter
      Parameters:
      attrName - attribute to check
      targetObject - target object which has attrName or not
      validateUnknown - true to validate unknown attribute for targetObject
      Returns:
      false if attrName is known attribute of targetObject
      true if attrName is unknown attribute of targetObject and validateUnknown is false
      Throws:
      com.documentum.fc.common.DfException - if attrName is unknown attribute of targetObject and validateUnknown is true
    • ignorableForUnmodified

      protected static boolean ignorableForUnmodified(Attribute<?> attribute, com.documentum.fc.client.IDfPersistentObject targetObject, boolean checkUnmodified) throws com.documentum.fc.common.DfException
      Check if attribute is unmodified attribute for targetObject, then decide whether to ignore it. Leverage this method to customize attributes filter.
      Parameters:
      attribute - attribute to check
      targetObject - target object which has same attribute with attribute or not
      checkUnmodified - true to check if attribute is unmodified attribute of targetObject
      Returns:
      false if checkUnmodified is false or targetObject has dirty data or attribute is not unmodified for targetObject
      true if checkUnmodified is true and targetObject has dirty data and attribute is unmodified for targetObject
      Throws:
      com.documentum.fc.common.DfException - the exception during the operation