code: public static Task fromProperties(String taskName, Properties properties) {
      String taskTypeString = properties.getProperty(TASK_TYPE_PARAMETER);
      if (null == taskTypeString) {
        throw new IllegalArgumentException(TASK_TYPE_PARAMETER + " property is missing: "
            + properties.toString());
      }
      Type type = Type.valueOf(taskTypeString);
      return type.createInstance(taskName, properties);
    }
docs: Construct a task from {@code Properties}. This method is used on the
  receiving side. That is, it is used to construct a {@code Task} from an
  HttpRequest sent from the App Engine task queue. {@code properties} must
  contain a property named {@link #TASK_TYPE_PARAMETER}. In addition it must
  contain the properties specified by the concrete subclass of this class
  corresponding to the task type.