summaryrefslogtreecommitdiff
path: root/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ExternalSystemSourceType.java
blob: ffe8a52d4a06f1112ef401859023795fb61790bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.intellij.openapi.externalSystem.model.project;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

/**
 * Enumerates module source types.
 * 
 * @author Denis Zhdanov
 * @since 8/10/11 5:21 PM
 */
public class ExternalSystemSourceType implements Serializable {

  @NotNull public static final ExternalSystemSourceType SOURCE   = new ExternalSystemSourceType("SOURCE");
  @NotNull public static final ExternalSystemSourceType TEST     = new ExternalSystemSourceType("TEST");
  @NotNull public static final ExternalSystemSourceType EXCLUDED = new ExternalSystemSourceType("EXCLUDED");
  @NotNull public static final ExternalSystemSourceType SOURCE_GENERATED = new ExternalSystemSourceType("SOURCE_GENERATED");
  @NotNull public static final ExternalSystemSourceType TEST_GENERATED  = new ExternalSystemSourceType("TEST_GENERATED");
  @NotNull public static final ExternalSystemSourceType RESOURCE  = new ExternalSystemSourceType("RESOURCE");
  @NotNull public static final ExternalSystemSourceType TEST_RESOURCE  = new ExternalSystemSourceType("TEST_RESOURCE");
  
  private static final long serialVersionUID = 1L;

  @NotNull private final String myId;

  public ExternalSystemSourceType(@NotNull String id) {
    myId = id;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    ExternalSystemSourceType type = (ExternalSystemSourceType)o;

    if (!myId.equals(type.myId)) return false;

    return true;
  }

  @Override
  public int hashCode() {
    return myId.hashCode();
  }

  @Override
  public String toString() {
    return myId;
  }
}