forked from SonarSource/sonarqube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONAR-6834 refactor CeQueue.submit()
Simon Brandhof
committed
Sep 21, 2015
1 parent
f6b8882
commit a47f15d
Showing
14 changed files
with
224 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
server/sonar-server/src/main/java/org/sonar/server/computation/CeTaskSubmit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* SonarQube, open source software quality management tool. | ||
* Copyright (C) 2008-2014 SonarSource | ||
* mailto:contact AT sonarsource DOT com | ||
* | ||
* SonarQube is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* SonarQube is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonar.server.computation; | ||
|
||
import java.util.Objects; | ||
import javax.annotation.CheckForNull; | ||
import javax.annotation.Nullable; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
import static com.google.common.base.Strings.emptyToNull; | ||
|
||
@Immutable | ||
public final class CeTaskSubmit { | ||
|
||
private final String uuid; | ||
private final String type; | ||
private final String componentUuid; | ||
private final String submitterLogin; | ||
|
||
private CeTaskSubmit(Builder builder) { | ||
this.uuid = Objects.requireNonNull(emptyToNull(builder.uuid)); | ||
this.type = Objects.requireNonNull(emptyToNull(builder.type)); | ||
this.componentUuid = emptyToNull(builder.componentUuid); | ||
this.submitterLogin = emptyToNull(builder.submitterLogin); | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public String getUuid() { | ||
return uuid; | ||
} | ||
|
||
@CheckForNull | ||
public String getComponentUuid() { | ||
return componentUuid; | ||
} | ||
|
||
@CheckForNull | ||
public String getSubmitterLogin() { | ||
return submitterLogin; | ||
} | ||
|
||
public static final class Builder { | ||
private final String uuid; | ||
private String type; | ||
private String componentUuid; | ||
private String submitterLogin; | ||
|
||
Builder(String uuid) { | ||
this.uuid = uuid; | ||
} | ||
|
||
public String getUuid() { | ||
return uuid; | ||
} | ||
|
||
public Builder setType(String s) { | ||
this.type = s; | ||
return this; | ||
} | ||
|
||
public Builder setComponentUuid(@Nullable String s) { | ||
this.componentUuid = s; | ||
return this; | ||
} | ||
|
||
public Builder setSubmitterLogin(@Nullable String s) { | ||
this.submitterLogin = s; | ||
return this; | ||
} | ||
|
||
public CeTaskSubmit build() { | ||
return new CeTaskSubmit(this); | ||
} | ||
} | ||
} |
Oops, something went wrong.