package jetbrains.mps.kotlin.stubs.common;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import org.jetbrains.mps.openapi.persistence.SModelIdFactory;
import org.jetbrains.mps.openapi.model.SModelId;

@GeneratedClass(node = "r:3391afe4-c131-4e6c-87cf-990834a43a93(jetbrains.mps.kotlin.stubs.common)/158649786167418137", model = "r:3391afe4-c131-4e6c-87cf-990834a43a93(jetbrains.mps.kotlin.stubs.common)")
public class KotlinJvmPackageModelId extends KotlinPackageModelId {
  private final int kotlinSalt = "kotlin_jvm".hashCode();

  public KotlinJvmPackageModelId(String packageName) {
    super(packageName);
  }

  @Override
  protected String getStereotype() {
    return KotlinLanguage.ModelKind.JVM.stereotype;
  }

  @Override
  public String getType() {
    return KotlinLanguage.ModelKind.JVM.name;
  }

  @Override
  public int hashCode() {
    // Some xor to differentiate kotlin and java packages
    return kotlinSalt ^ myPackageName.hashCode();
  }

  public static final class Factory implements SModelIdFactory {
    @Override
    public SModelId create(String packageName) {
      assert packageName != null;
      // TODO make validation on name?
      return new KotlinJvmPackageModelId(packageName);
    }
  }
}
