code: public <T> TaskStatus<T> toTaskStatus(PersistentExecutor executor) {
          return new TaskStatusImpl<T>(this, (PersistentExecutorImpl) executor);
      }
docs: Constructs a new TaskStatus instance corresponding to the state of this task record as of the point in time
  when the method is invoked. The following attributes must be set on the task record before invoking this method:
  (Id, IdentifierOfClassLoader, MiscBinaryFlags, Name, NextExecutionTime, Result, State, Trigger)
  
  @param executor persistent executor instance.
  @return a new TaskStatus instance corresponding to this task record.