Class Audited


  • public final class Audited
    extends java.lang.Object
    Carries immutable information about an audited persistent instance.
    Author:
    Pinaki Poddar
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getManagedObject()
      Gets the current state of the persistent instance.
      java.lang.Object getManangedFieldValue​(java.lang.String field)
      Gets the value of the given field of the managed object.
      java.lang.Object getOriginalFieldValue​(java.lang.String field)
      Gets the value of the given field of the original state of the object.
      java.lang.Object getOriginalObject()
      Gets the original state of the persistent instance as a transient instance.
      AuditableOperation getType()
      Gets the type of this audit.
      java.lang.String[] getUpdatedFields()
      Gets the name of the updated fields.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getManagedObject

        public java.lang.Object getManagedObject()
        Gets the current state of the persistent instance.
      • getOriginalObject

        public java.lang.Object getOriginalObject()
        Gets the original state of the persistent instance as a transient instance.
      • getUpdatedFields

        public java.lang.String[] getUpdatedFields()
        Gets the name of the updated fields.
        Returns:
        persistent property names that are modified. For deleted instances the array is empty and for newly created instances the array contains all the fields.
      • getManangedFieldValue

        public java.lang.Object getManangedFieldValue​(java.lang.String field)
        Gets the value of the given field of the managed object.
        Parameters:
        field - name of a persistent property
        Returns:
        value of the given field in the managed instance
        Throws:
        java.lang.IllegalArgumentException - if the named field is not a persistent property
      • getOriginalFieldValue

        public java.lang.Object getOriginalFieldValue​(java.lang.String field)
        Gets the value of the given field of the original state of the object.
        Parameters:
        field - name of a persistent property
        Returns:
        value of the given field in the original instance
        Throws:
        java.lang.IllegalArgumentException - if the named field is not a persistent property