Class ObjectCreate<T>

java.lang.Object
io.permazen.change.Change<T>
io.permazen.change.ObjectCreate<T>
Type Parameters:
T - the type of the object that was created

public class ObjectCreate<T> extends Change<T>
Change notification that indicates a new object has been created.

This type of change notification is never generated by Permazen itself; object creation notifications are instead delivered to @OnCreate methods, which do not take any parameters. This class exists as a convenience for application code that may want to unify handling of object change and object lifecycle events.

  • Constructor Details

    • ObjectCreate

      public ObjectCreate(T jobj)
      Constructor.
      Parameters:
      jobj - Java model object that was created
      Throws:
      IllegalArgumentException - if jobj is null
  • Method Details

    • visit

      public <R> R visit(ChangeSwitch<R> target)
      Description copied from class: Change
      Apply visitor pattern. Invokes the method of target corresponding to this instance's type.
      Specified by:
      visit in class Change<T>
      Type Parameters:
      R - visitor return type
      Parameters:
      target - visitor pattern target
      Returns:
      value returned by the selected method of target
    • apply

      public void apply(PermazenTransaction jtx, PermazenObject jobj)
      Description copied from class: Change
      Apply this change to the given object in the given transaction.
      Specified by:
      apply in class Change<T>
      Parameters:
      jtx - the transaction in which to apply this change
      jobj - the target object to which to apply this change
    • toString

      public String toString()
      Overrides:
      toString in class Object