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
cab7f054
Commit
cab7f054
authored
Nov 28, 2018
by
mdeknowis
Committed by
Greg Messner
Nov 28, 2018
Browse files
Add withXxxxx() methods to AbstractUser (#273)
parent
c9225298
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/AbstractUser.java
View file @
cab7f054
...
...
@@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
AbstractUser
{
public
abstract
class
AbstractUser
<
U
extends
AbstractUser
<
U
>>
{
private
String
avatarUrl
;
private
String
bio
;
...
...
@@ -300,4 +300,197 @@ public class AbstractUser {
public
void
setCustomAttributes
(
List
<
CustomAttribute
>
customAttributes
)
{
this
.
customAttributes
=
customAttributes
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withAvatarUrl
(
String
avatarUrl
)
{
this
.
avatarUrl
=
avatarUrl
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withBio
(
String
bio
)
{
this
.
bio
=
bio
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withCanCreateGroup
(
Boolean
canCreateGroup
)
{
this
.
canCreateGroup
=
canCreateGroup
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withCanCreateProject
(
Boolean
canCreateProject
)
{
this
.
canCreateProject
=
canCreateProject
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withColorSchemeId
(
Integer
colorSchemeId
)
{
this
.
colorSchemeId
=
colorSchemeId
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withConfirmedAt
(
Date
confirmedAt
)
{
this
.
confirmedAt
=
confirmedAt
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withCreatedAt
(
Date
createdAt
)
{
this
.
createdAt
=
createdAt
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withCurrentSignInAt
(
Date
currentSignInAt
)
{
this
.
currentSignInAt
=
currentSignInAt
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withEmail
(
String
email
)
{
this
.
email
=
email
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withExternal
(
Boolean
external
)
{
this
.
external
=
external
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withId
(
Integer
id
)
{
this
.
id
=
id
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withIdentities
(
List
<
Identity
>
identities
)
{
this
.
identities
=
identities
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withIsAdmin
(
Boolean
isAdmin
)
{
this
.
isAdmin
=
isAdmin
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withLastActivityOn
(
Date
lastActivityOn
)
{
this
.
lastActivityOn
=
lastActivityOn
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withLastSignInAt
(
Date
lastSignInAt
)
{
this
.
lastSignInAt
=
lastSignInAt
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withLinkedin
(
String
linkedin
)
{
this
.
linkedin
=
linkedin
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withLocation
(
String
location
)
{
this
.
location
=
location
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withName
(
String
name
)
{
this
.
name
=
name
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withOrganization
(
String
organization
)
{
this
.
organization
=
organization
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withProjectsLimit
(
Integer
projectsLimit
)
{
this
.
projectsLimit
=
projectsLimit
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withProvider
(
String
provider
)
{
this
.
provider
=
provider
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withSharedRunnersMinutesLimit
(
Integer
sharedRunnersMinutesLimit
)
{
this
.
sharedRunnersMinutesLimit
=
sharedRunnersMinutesLimit
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withSkype
(
String
skype
)
{
this
.
skype
=
skype
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withState
(
String
state
)
{
this
.
state
=
state
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withThemeId
(
Integer
themeId
)
{
this
.
themeId
=
themeId
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withTwitter
(
String
twitter
)
{
this
.
twitter
=
twitter
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withTwoFactorEnabled
(
Boolean
twoFactorEnabled
)
{
this
.
twoFactorEnabled
=
twoFactorEnabled
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withUsername
(
String
username
)
{
this
.
username
=
username
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withWebsiteUrl
(
String
websiteUrl
)
{
this
.
websiteUrl
=
websiteUrl
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withWebUrl
(
String
webUrl
)
{
this
.
webUrl
=
webUrl
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withSkipConfirmation
(
Boolean
skipConfirmation
)
{
this
.
skipConfirmation
=
skipConfirmation
;
return
(
U
)
this
;
}
@SuppressWarnings
(
"unchecked"
)
public
U
withCustomAttributes
(
List
<
CustomAttribute
>
customAttributes
)
{
this
.
customAttributes
=
customAttributes
;
return
(
U
)
this
;
}
}
src/main/java/org/gitlab4j/api/models/Assignee.java
View file @
cab7f054
...
...
@@ -4,5 +4,5 @@ package org.gitlab4j.api.models;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
public
class
Assignee
extends
AbstractUser
{
public
class
Assignee
extends
AbstractUser
<
Assignee
>
{
}
src/main/java/org/gitlab4j/api/models/Author.java
View file @
cab7f054
...
...
@@ -4,5 +4,5 @@ package org.gitlab4j.api.models;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
public
class
Author
extends
AbstractUser
{
public
class
Author
extends
AbstractUser
<
Author
>
{
}
src/main/java/org/gitlab4j/api/models/Contributor.java
View file @
cab7f054
...
...
@@ -3,5 +3,5 @@ package org.gitlab4j.api.models;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
public
class
Contributor
extends
AbstractUser
{
public
class
Contributor
extends
AbstractUser
<
Contributor
>
{
}
\ No newline at end of file
src/main/java/org/gitlab4j/api/models/Participant.java
View file @
cab7f054
...
...
@@ -3,5 +3,5 @@ package org.gitlab4j.api.models;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
public
class
Participant
extends
AbstractUser
{
public
class
Participant
extends
AbstractUser
<
Participant
>
{
}
\ No newline at end of file
src/main/java/org/gitlab4j/api/models/User.java
View file @
cab7f054
package
org.gitlab4j.api.models
;
import
javax.xml.bind.annotation.XmlRootElement
;
import
java.util.List
;
@XmlRootElement
public
class
User
extends
AbstractUser
{
public
class
User
extends
AbstractUser
<
User
>
{
private
String
externUid
;
public
void
setExternUid
(
String
externUid
)
{
...
...
@@ -15,49 +14,13 @@ public class User extends AbstractUser {
return
this
.
externUid
;
}
public
User
withEmail
(
String
email
)
{
setEmail
(
email
);
return
this
;
}
public
User
withName
(
String
name
)
{
setName
(
name
);
return
this
;
}
public
User
withUsername
(
String
username
)
{
setUsername
(
username
);
return
this
;
}
public
User
withSkype
(
String
skype
)
{
setSkype
(
skype
);
return
this
;
}
public
User
withLinkedin
(
String
linkedIn
)
{
setLinkedin
(
linkedIn
);
return
this
;
}
public
User
withTwitter
(
String
twitter
)
{
setTwitter
(
twitter
);
return
this
;
}
public
User
withWebsiteUrl
(
String
websiteUrl
)
{
setWebsiteUrl
(
websiteUrl
);
return
this
;
}
public
User
withOrganization
(
String
organization
)
{
setOrganization
(
organization
);
return
this
;
}
/**
* @deprecated Replaced by {@link #withProjectsLimit(Integer)}
* @see #withProjectsLimit(Integer)
*/
@Deprecated
public
User
withProjectLimit
(
Integer
projectsLimit
)
{
setProjectsLimit
(
projectsLimit
);
return
this
;
return
withProjectsLimit
(
projectsLimit
);
}
public
User
withExternUid
(
String
externUid
)
{
...
...
@@ -65,48 +28,13 @@ public class User extends AbstractUser {
return
this
;
}
public
User
withProvider
(
String
provider
)
{
setProvider
(
provider
);
return
this
;
}
public
User
withBio
(
String
bio
)
{
setBio
(
bio
);
return
this
;
}
public
User
withLocation
(
String
location
)
{
setLocation
(
location
);
return
this
;
}
public
User
withIsAdmin
(
Boolean
isAdmin
)
{
setIsAdmin
(
isAdmin
);
return
this
;
}
public
User
withCanCreateGroup
(
Boolean
canCreateGroup
)
{
setCanCreateGroup
(
canCreateGroup
);
return
this
;
}
public
User
withSkipConfirmation
(
Boolean
skipConfirmation
)
{
setSkipConfirmation
(
skipConfirmation
);
return
this
;
}
public
User
withExternal
(
Boolean
external
)
{
setExternal
(
external
);
return
this
;
}
/**
* @deprecated Replaced by {@link #withSharedRunnersMinutesLimit(Integer)}
* @see #withSharedRunnersMinutesLimit(Integer)
*/
@Deprecated
public
User
withSharedRunnersMinuteLimit
(
Integer
sharedRunnersMinuteLimit
)
{
setSharedRunnersMinutesLimit
(
sharedRunnersMinuteLimit
);
return
this
;
return
withSharedRunnersMinutesLimit
(
sharedRunnersMinuteLimit
);
}
public
User
withCustomAttributes
(
List
<
CustomAttribute
>
customAttributes
)
{
setCustomAttributes
(
customAttributes
);
return
this
;
}
}
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