This repository was archived by the owner on Feb 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
87 additions
and
43 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
src/main/java/org/jenkinsci/plugins/typetalk/webhookaction/ResponseParameter.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,60 @@ | ||
package org.jenkinsci.plugins.typetalk.webhookaction; | ||
|
||
import hudson.model.AbstractProject; | ||
import org.jenkinsci.plugins.typetalk.api.TypetalkMessage; | ||
|
||
import java.util.List; | ||
|
||
public class ResponseParameter { | ||
|
||
private String description; | ||
|
||
public String getDescription() { | ||
return description != null ? description : message; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
private final String message; | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
private TypetalkMessage.Emoji emoji = TypetalkMessage.Emoji.SMILEY; | ||
|
||
public TypetalkMessage.Emoji getEmoji() { | ||
return emoji; | ||
} | ||
|
||
public void setEmoji(TypetalkMessage.Emoji emoji) { | ||
this.emoji = emoji; | ||
} | ||
|
||
private AbstractProject project; | ||
|
||
public AbstractProject getProject() { | ||
return project; | ||
} | ||
|
||
public void setProject(AbstractProject project) { | ||
this.project = project; | ||
} | ||
|
||
public ResponseParameter(String message) { | ||
this.message = message; | ||
} | ||
|
||
public static String flatMessages(List<String> messages) { | ||
StringBuilder builder = new StringBuilder(); | ||
for (int i = 0; i < messages.size() - 1; i++) { | ||
builder.append(messages.get(i) + "\n"); | ||
} | ||
builder.append(messages.get(messages.size() - 1)); | ||
|
||
return builder.toString(); | ||
} | ||
|
||
} |
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
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