Unverified Commit bae822a4 authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze Committed by GitHub
Browse files

Merge pull request #722 from gitlab4j/issue-626-add-missing-properties-to-branch-model

Fix #626 : Add missing properties to Branch model
parents b442f13a 847ce9ee
......@@ -11,6 +11,9 @@ public class Branch {
private Boolean merged;
private String name;
private Boolean isProtected;
private Boolean isDefault;
private Boolean canPush;
private String webUrl;
public Commit getCommit() {
return commit;
......@@ -60,6 +63,30 @@ public class Branch {
this.isProtected = isProtected;
}
public Boolean getDefault() {
return isDefault;
}
public void setDefault(Boolean isDefault) {
this.isDefault = isDefault;
}
public Boolean getCanPush() {
return canPush;
}
public void setCanPush(Boolean canPush) {
this.canPush = canPush;
}
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
public static final boolean isValid(Branch branch) {
return (branch != null && branch.getName() != null);
}
......@@ -80,11 +107,23 @@ public class Branch {
return this;
}
/**
* Set the merged attribute
* @param merged
* @deprecated Use {@link #withMerged(Boolean)} instead
* @return Current branch instance
*/
@Deprecated
public Branch withDerged(Boolean merged) {
this.merged = merged;
return this;
}
public Branch withMerged(Boolean merged) {
this.merged = merged;
return this;
}
public Branch withName(String name) {
this.name = name;
return this;
......
......@@ -2,8 +2,11 @@
"name": "master",
"merged": false,
"protected": true,
"default": true,
"developers_can_push": false,
"developers_can_merge": false,
"can_push": true,
"web_url": "http://gitlab.example.com/my-group/my-project/-/tree/master",
"commit": {
"author_email": "john@example.com",
"author_name": "John Smith",
......@@ -12,6 +15,8 @@
"committer_email": "john@example.com",
"committer_name": "John Smith",
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
"short_id": "7b5c3cc",
"title": "add projects API",
"message": "add projects API",
"parent_ids": [
"4ad91d3c1144c406e50c7b33bae684bd6837faf8"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment