Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
847ce9ee
Unverified
Commit
847ce9ee
authored
Jun 26, 2021
by
Gautier de Saint Martin Lacaze
Browse files
Fix #626 : Add missing properties to Branch model
parent
b442f13a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/Branch.java
View file @
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
;
...
...
src/test/resources/org/gitlab4j/api/branch.json
View file @
847ce9ee
...
...
@@ -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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment