Class ElementState<O extends ObjectType>

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class ElementState<O extends ObjectType>
    extends Object
    implements Serializable, Cloneable
    Encapsulates the maintenance of the state of an element (focus, projection). Holds mainly: - basic information like type, definition, and OID - state: old, current, new - deltas: primary, secondary, current (i.e. current -> new), summary (i.e. old -> new) - archived secondary deltas - flags related to the validity of computed components (see below), to avoid needless recomputation - various other state flags (see in the description) Implementation notes: 1. Computed components (current, summary delta, adjusted current object, new object) are evaluated lazily. Their validity is indicated by appropriate flags, driving their (re)computation. 2. Because of their complexity and interdependence, state-changing operations are grouped in a separate region: State updates.
    See Also:
    Serialized Form
    • Method Detail

      • getOid

        public String getOid()
      • getArchivedSecondaryDeltas

        @NotNull
        public @NotNull ObjectDeltaWaves<O> getArchivedSecondaryDeltas()
      • setCurrentObjectAndOid

        public void setCurrentObjectAndOid​(@NotNull
                                           @NotNull PrismObject<O> object)
        Sets the current object and updates the OID as well. Used when OID may change (on projections). Should be used only by the context loader.
      • setLoadedObject

        public void setLoadedObject​(@NotNull
                                    @NotNull PrismObject<O> object,
                                    boolean add)
        Sets both current and (if needed) also the old object. Should be used only by the context loader.
      • setInitialObject

        public void setInitialObject​(@NotNull
                                     @NotNull PrismObject<O> object,
                                     boolean add)
        Sets both current and (if applicable) the old object. Almost the same as setLoadedObject(PrismObject, boolean) but the old object is updated regardless of whether it was already set or not.
      • rememberState

        @NotNull
        public @NotNull RememberedElementState<O> rememberState()
        Creates a representation of a state to be (maybe) restored later. Currently comprises only the secondary deltas. Later we may add also current and summary deltas and new object.
      • normalize

        public void normalize()