package com.oguerreiro.resilient.activity;

import java.util.HashMap;
import java.util.Map;

import com.oguerreiro.resilient.activity.registry.ActivityProgressDescriptor;

public class GenericGuide<AD extends ActivityDomain> implements ActivityGuide, TaskGuide {
  private final String username;
  private final ActivityProgressDescriptor activityProgressDescriptor;
  private AD activityDomain;
  public Map<String, Object> otherValues = new HashMap<String, Object>();

  protected GenericGuide(ActivityProgressDescriptor activityProgressDescriptor, AD activityDomain, String username) {
    this.username = username;
    this.activityProgressDescriptor = activityProgressDescriptor;
    this.activityDomain = activityDomain;
  }

  public static <AD extends ActivityDomain> GenericGuide<AD> create(
      ActivityProgressDescriptor activityProgressDescriptor, AD activityDomain, String username) {
    return new GenericGuide<AD>(activityProgressDescriptor, activityDomain, username);
  }

  @Override
  public String getUsername() {
    return this.username;
  }

  @Override
  public ActivityProgressDescriptor getActivityProgressDescriptor() {
    return this.activityProgressDescriptor;
  }

  public AD getActivityDomain() {
    return this.activityDomain;
  }

  public void setActivityDomain(AD activityDomain) {
    this.activityDomain = activityDomain;
  }
}
