2 * Copyright 2000-2014 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.jetbrains.plugins.gradle.tooling.internal;
18 import org.gradle.tooling.model.DomainObjectSet;
19 import org.gradle.tooling.model.internal.ImmutableDomainObjectSet;
20 import org.jetbrains.plugins.gradle.model.ExtIdeaCompilerOutput;
21 import org.jetbrains.plugins.gradle.model.ExtIdeaContentRoot;
22 import org.jetbrains.plugins.gradle.model.ModuleExtendedModel;
25 import java.util.Collections;
26 import java.util.List;
30 * @author Vladislav.Soroka
33 public class ModuleExtendedModelImpl implements ModuleExtendedModel {
34 private final String myName;
35 private final String myGroup;
36 private final String myVersion;
37 private final File myBuildDir;
38 private List<File> myArtifacts;
39 private Set<ExtIdeaContentRoot> myContentRoots;
40 private ExtIdeaCompilerOutput myCompilerOutput;
42 public ModuleExtendedModelImpl(String name, String group, String version, File buildDir) {
46 myBuildDir = buildDir;
47 myArtifacts = Collections.emptyList();
48 myContentRoots = Collections.emptySet();
52 public String getName() {
57 public String getGroup() {
62 public String getVersion() {
67 public List<File> getArtifacts() {
71 public void setArtifacts(List<File> artifacts) {
72 this.myArtifacts = artifacts == null ? Collections.<File>emptyList() : artifacts;
76 public DomainObjectSet<? extends ExtIdeaContentRoot> getContentRoots() {
77 return ImmutableDomainObjectSet.of(myContentRoots);
81 public File getBuildDir() {
85 public void setContentRoots(Set<ExtIdeaContentRoot> contentRoots) {
86 myContentRoots = contentRoots == null ? Collections.<ExtIdeaContentRoot>emptySet() : contentRoots;
90 public ExtIdeaCompilerOutput getCompilerOutput() {
91 return myCompilerOutput;
94 public void setCompilerOutput(ExtIdeaCompilerOutput compilerOutput) {
95 myCompilerOutput = compilerOutput;