mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
49 lines
1.9 KiB
Java
49 lines
1.9 KiB
Java
package com.fastaccess.provider.rest;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import com.fastaccess.data.dao.types.IssueState;
|
|
|
|
/**
|
|
* Created by Kosh on 23 Mar 2017, 7:26 PM
|
|
*/
|
|
|
|
public class RepoQueryProvider {
|
|
@NonNull public static String getIssuesPullRequestQuery(@NonNull String owner, @NonNull String repo,
|
|
@NonNull IssueState issueState, boolean isPr) {
|
|
return "+" + "type:" + (isPr ? "pr" : "issue") +
|
|
"+" + "repo:" + owner + "/" +
|
|
repo + "+" + "is:" + issueState.name();
|
|
}
|
|
|
|
@NonNull public static String getMyIssuesPullRequestQuery(@NonNull String username, @NonNull IssueState issueState, boolean isPr) {
|
|
return "type:" + (isPr ? "pr" : "issue") +
|
|
"+" + "author:" + username +
|
|
"+is:" + issueState.name();
|
|
}
|
|
|
|
@NonNull public static String getAssigned(@NonNull String username, @NonNull IssueState issueState, boolean isPr) {
|
|
return "type:" + (isPr ? "pr" : "issue") +
|
|
"+" + "assignee:" + username +
|
|
"+is:" + issueState.name();
|
|
}
|
|
|
|
@NonNull public static String getMentioned(@NonNull String username, @NonNull IssueState issueState, boolean isPr) {
|
|
return "type:" + (isPr ? "pr" : "issue") +
|
|
"+" + "mentions:" + username +
|
|
"+is:" + issueState.name();
|
|
}
|
|
|
|
@NonNull public static String getReviewRequests(@NonNull String username, @NonNull IssueState issueState) {
|
|
return "type:pr" +
|
|
"+" + "review-requested:" + username +
|
|
"+is:" + issueState.name();
|
|
}
|
|
|
|
public static String getParticipated(@NonNull String username, @NonNull IssueState issueState, boolean isPr) {
|
|
return "type:" + (isPr ? "pr" : "issue") +
|
|
"+" + "involves:" + username +
|
|
"+is:" + issueState.name();
|
|
}
|
|
}
|