Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Wiest
unified-ticketing
Commits
1e4434ab
Verified
Commit
1e4434ab
authored
Nov 10, 2020
by
Lukas Wiest
🚂
Browse files
refactor(core/TicketBuilder): make assignees setter non abstract and use string
parent
e5869d6b
Pipeline
#1247
passed with stages
in 2 minutes and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/hftstuttgart/unifiedticketing/core/TicketBuilder.java
View file @
1e4434ab
...
...
@@ -20,7 +20,7 @@ public abstract class TicketBuilder<B extends TicketBuilder, T extends Ticket, T
public
final
TS
parent
;
protected
Set
<
Integer
>
assignees
;
protected
Set
<
String
>
assignees
;
protected
String
description
;
protected
Set
<
String
>
labels
;
protected
String
title
;
...
...
@@ -37,7 +37,11 @@ public abstract class TicketBuilder<B extends TicketBuilder, T extends Ticket, T
logger
.
log
(
Level
.
FINEST
,
String
.
format
(
"%s instantiated"
,
this
.
getClass
().
getSimpleName
()));
}
public
abstract
B
assignees
(
String
...
identifiers
);
public
B
assignees
(
String
...
identifiers
)
{
this
.
assignees
=
new
HashSet
<>(
Arrays
.
asList
(
identifiers
));
return
(
B
)
this
;
}
public
B
description
(
String
description
)
{
...
...
src/main/java/de/hftstuttgart/unifiedticketing/systems/gitlab/GitlabTicketBuilder.java
View file @
1e4434ab
...
...
@@ -29,12 +29,10 @@ public class GitlabTicketBuilder extends TicketBuilder<GitlabTicketBuilder, Gitl
@Override
public
GitlabTicketBuilder
assignees
(
String
...
identifiers
)
{
try
{
assignees
(
Arrays
.
stream
(
identifiers
)
.
mapToInt
(
Integer:
:
parseInt
)
.
toArray
());
Arrays
.
stream
(
identifiers
)
.
forEach
(
Integer:
:
parseInt
);
}
catch
(
NumberFormatException
e
)
{
...
...
@@ -42,15 +40,14 @@ public class GitlabTicketBuilder extends TicketBuilder<GitlabTicketBuilder, Gitl
throw
new
AssertionException
(
e
);
}
return
this
;
return
super
.
assignees
(
identifiers
)
;
}
public
GitlabTicketBuilder
assignees
(
int
...
identifiers
)
{
assignees
=
Arrays
.
stream
(
identifiers
)
.
mapToObj
(
i
->
(
Integer
)
i
)
.
collect
(
Collectors
.
toSet
());
return
this
;
return
super
.
assignees
(
Arrays
.
stream
(
identifiers
)
.
mapToObj
(
String:
:
valueOf
)
.
toArray
(
String
[]::
new
));
}
protected
OkHttpClient
getHttpClient
()
{
return
new
OkHttpClient
();
}
...
...
@@ -83,7 +80,10 @@ public class GitlabTicketBuilder extends TicketBuilder<GitlabTicketBuilder, Gitl
if
(
this
.
assignees
!=
null
)
{
ArrayNode
ids
=
body
.
putArray
(
"assignee_ids"
);
assignees
.
forEach
(
ids:
:
add
);
assignees
.
stream
()
.
mapToInt
(
Integer:
:
parseInt
)
.
forEach
(
ids:
:
add
);
logger
.
log
(
Level
.
FINEST
,
"assignees set"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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