Skip to content

Commit bb52716

Browse files
Ruben Vittgmessner
authored andcommitted
Add fluent interface implementation to Group, Member, and Namespace models (#231)
* add fluid property-setter to Group model * add fluid property-setter to Member model * add fluid property-setter to Namespace model
1 parent 4c7ec4e commit bb52716

File tree

3 files changed

+130
-0
lines changed

3 files changed

+130
-0
lines changed

src/main/java/org/gitlab4j/api/models/Group.java

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,84 @@ public List<Project> getSharedProjects() {
195195
public void setSharedProjects(List<Project> sharedProjects) {
196196
this.sharedProjects = sharedProjects;
197197
}
198+
199+
public Group withId(Integer id) {
200+
this.id = id;
201+
return this;
202+
}
203+
204+
public Group withName(String name) {
205+
this.name = name;
206+
return this;
207+
}
208+
209+
public Group withPath(String path) {
210+
this.path = path;
211+
return this;
212+
}
213+
214+
public Group withDescription(String description) {
215+
this.description = description;
216+
return this;
217+
}
218+
219+
public Group withVisibility(Visibility visibility) {
220+
this.visibility = visibility;
221+
return this;
222+
}
223+
224+
public Group withlfsEnabled(boolean lfsEnabled) {
225+
this.lfsEnabled = lfsEnabled;
226+
return this;
227+
}
228+
229+
public Group withAvatarUrl(String avatarUrl) {
230+
this.avatarUrl = avatarUrl;
231+
return this;
232+
}
233+
234+
public Group withWebUrl(String url) {
235+
this.webUrl = url;
236+
return this;
237+
}
238+
239+
public Group withRequestAccessEnabled(boolean requestAccessEnabled) {
240+
this.requestAccessEnabled = requestAccessEnabled;
241+
return this;
242+
}
243+
244+
public Group withFullName(String fullName) {
245+
this.fullName = fullName;
246+
return this;
247+
}
248+
249+
public Group withFullPath(String fullPath) {
250+
this.fullPath = fullPath;
251+
return this;
252+
}
253+
254+
public Group withParentId(Integer parentId) {
255+
this.parentId = parentId;
256+
return this;
257+
}
258+
259+
public Group withSharedRunnersMinutesLimit(Integer minutesLimit) {
260+
this.sharedRunnersMinutesLimit = minutesLimit;
261+
return this;
262+
}
263+
264+
public Group withStatistics(Statistics statistics) {
265+
this.statistics = statistics;
266+
return this;
267+
}
268+
269+
public Group withProjects(List<Project> projects) {
270+
this.projects = projects;
271+
return this;
272+
}
273+
274+
public Group withSharedProjects(List<Project> sharedProjects) {
275+
this.sharedProjects = sharedProjects;
276+
return this;
277+
}
198278
}

src/main/java/org/gitlab4j/api/models/Member.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,29 @@ public String getUsername() {
6565
public void setUsername(String username) {
6666
this.username = username;
6767
}
68+
69+
public Member withAccessLevel(AccessLevel accessLevel) {
70+
this.accessLevel = accessLevel;
71+
return this;
72+
}
73+
74+
public Member withCreatedAt(Date createdAt) {
75+
this.createdAt = createdAt;
76+
return this;
77+
}
78+
79+
public Member withId(Integer id) {
80+
this.id = id;
81+
return this;
82+
}
83+
84+
public Member withState(String state) {
85+
this.state = state;
86+
return this;
87+
}
88+
89+
public Member withUsername(String username) {
90+
this.username = username;
91+
return this;
92+
}
6893
}

src/main/java/org/gitlab4j/api/models/Namespace.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,29 @@ public String getFullPath() {
5353
public void setFullPath(String fullPath) {
5454
this.fullPath = fullPath;
5555
}
56+
57+
public Namespace withId(Integer id) {
58+
this.id = id;
59+
return this;
60+
}
61+
62+
public Namespace withName(String name) {
63+
this.name = name;
64+
return this;
65+
}
66+
67+
public Namespace withPath(String path) {
68+
this.path = path;
69+
return this;
70+
}
71+
72+
public Namespace withKind(String kind) {
73+
this.kind = kind;
74+
return this;
75+
}
76+
77+
public Namespace withFullPath(String fullPath) {
78+
this.fullPath = fullPath;
79+
return this;
80+
}
5681
}

0 commit comments

Comments
 (0)