Class AuditEvent.AuditEventBuilder

    • Method Detail

      • attribute

        public AuditEvent.AuditEventBuilder attribute​(String title,
                                                      Object value)
        Adds an attribute for the event to generate, to help at identifying the context of the event.
        Parameters:
        title - the attribute title
        value - the attribute value (to convert to a String), which may be null
        Returns:
        this builder
        Throws:
        NullPointerException - if title is null
      • changedValue

        public AuditEvent.AuditEventBuilder changedValue​(String title,
                                                         Object from,
                                                         Object to)
        Adds a value that was changed along the event, to trace the previous and new values.
        Parameters:
        title - the title associated to the value
        from - the previous value (to convert to a String), which may be null
        to - the new value (to convert to a String), which may be null
        Returns:
        this builder
        Throws:
        NullPointerException - if title is null
      • affects

        public AuditEvent.AuditEventBuilder affects​(Link affectedResource)
        Adds a resource that is affected by the event. The resource must have a label and may have a URI, which the administrator can navigate to, when event is displayed in audit page.
        Parameters:
        affectedResource - the resource affected by the event
        Returns:
        this builder
        Throws:
        NullPointerException - if affectedResource or its label is null
      • build

        public AuditEvent build()
        Builds the configured audit event.
        Returns:
        an audit event