class RuleLink {

  private static final String DEACTIVATE_URL = "http://languagetool.org/deactivate/";
  private static final String REACTIVATE_URL = "http://languagetool.org/reactivate/";

  private final String urlPrefix;
  private final String id;

  private RuleLink(String urlPrefix, String id) {
    this.urlPrefix = urlPrefix;
    this.id = id;
  }

  static RuleLink buildDeactivationLink(Rule rule) {
    return new RuleLink(DEACTIVATE_URL, rule.getId());
  }

  static RuleLink buildReactivationLink(Rule rule) {
    return new RuleLink(REACTIVATE_URL, rule.getId());
  }

  static RuleLink getFromString(String ruleLink) {<FILL_FUNCTION_BODY>}

  String getId() {
    return id;
  }

  @Override
  public String toString() {
    return urlPrefix + id;
  }

}

    String id;
    if (ruleLink.startsWith(DEACTIVATE_URL)) {
      id = ruleLink.substring(DEACTIVATE_URL.length());
      return new RuleLink(DEACTIVATE_URL, id);
    } else if (ruleLink.startsWith(REACTIVATE_URL)) {
      id = ruleLink.substring(REACTIVATE_URL.length());
      return new RuleLink(REACTIVATE_URL, id);
    } else {
      throw new RuntimeException("Unknown link prefix: " + ruleLink);
    }
  
<no_super_class>