FastHub/app/src/main/java/com/fastaccess/provider/rest/RepoQueryProvider.java
Kosh 09e586a8b0 this commit fixes #220 .
Now you can add labels from FastHub.
2017-04-02 18:07:44 +08:00

37 lines
1.4 KiB
Java

package com.fastaccess.provider.rest;
import android.support.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();
}
}