summaryrefslogtreecommitdiff
path: root/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DefaultExternalSourceDirectorySet.java
blob: d6a8d7aa62918cff83d3e86fe024ef1b9ed50f58 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.openapi.externalSystem.model;

import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author Vladislav.Soroka
 * @since 7/14/2014
 */
public class DefaultExternalSourceDirectorySet implements ExternalSourceDirectorySet {
  private static final long serialVersionUID = 1L;

  @NotNull
  private String myName;
  @NotNull
  private Set<File> mySrcDirs;
  @NotNull
  private File myOutputDir;
  @NotNull
  private Set<String> myExcludes;
  @NotNull
  private Set<String> myIncludes;
  @NotNull
  private List<ExternalFilter> myFilters;

  public DefaultExternalSourceDirectorySet() {
    mySrcDirs = new HashSet<File>();
    myExcludes = new HashSet<String>();
    myIncludes = new HashSet<String>();
    myFilters = new ArrayList<ExternalFilter>();
  }

  public DefaultExternalSourceDirectorySet(ExternalSourceDirectorySet sourceDirectorySet) {
    this();
    myName = sourceDirectorySet.getName();
    mySrcDirs = new HashSet<File>(sourceDirectorySet.getSrcDirs());
    myOutputDir = sourceDirectorySet.getOutputDir();
    myExcludes = new HashSet<String>(sourceDirectorySet.getExcludes());
    myIncludes = new HashSet<String>(sourceDirectorySet.getIncludes());
    for (ExternalFilter filter : sourceDirectorySet.getFilters()) {
      myFilters.add(new DefaultExternalFilter(filter));
    }
  }

  @NotNull
  @Override
  public String getName() {
    return myName;
  }

  public void setName(@NotNull String name) {
    myName = name;
  }

  @NotNull
  @Override
  public Set<File> getSrcDirs() {
    return mySrcDirs;
  }

  public void setSrcDirs(@NotNull Set<File> srcDirs) {
    mySrcDirs = srcDirs;
  }

  @NotNull
  @Override
  public File getOutputDir() {
    return myOutputDir;
  }

  @NotNull
  @Override
  public Set<String> getIncludes() {
    return myIncludes;
  }

  public void setIncludes(@NotNull Set<String> includes) {
    myIncludes = includes;
  }

  @NotNull
  @Override
  public Set<String> getExcludes() {
    return myExcludes;
  }

  public void setExcludes(@NotNull Set<String> excludes) {
    myExcludes = excludes;
  }

  @NotNull
  @Override
  public List<ExternalFilter> getFilters() {
    return myFilters;
  }

  public void setFilters(@NotNull List<ExternalFilter> filters) {
    myFilters = filters;
  }

  public void setOutputDir(@NotNull File outputDir) {
    myOutputDir = outputDir;
  }
}