Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fidentis
Analyst WebApp
Commits
477e282c
There was an error fetching the commit references. Please try again later.
Commit
477e282c
authored
3 years ago
by
Matej Kovár
Browse files
Options
Downloads
Patches
Plain Diff
fixed javadocs, added checks whether method inputs are valid or not
parent
3af86a10
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Comparison/src/main/java/cz/fidentis/analyst/Project.java
+28
-3
28 additions, 3 deletions
Comparison/src/main/java/cz/fidentis/analyst/Project.java
with
28 additions
and
3 deletions
Comparison/src/main/java/cz/fidentis/analyst/Project.java
+
28
−
3
View file @
477e282c
...
...
@@ -18,7 +18,8 @@ public class Project {
/**
* Returns primary face
* @return primary face
*
* @return HumanFace primary face
*/
public
HumanFace
getPrimaryFace
()
{
return
primaryFace
;
...
...
@@ -26,15 +27,21 @@ public class Project {
/**
* Sets new primary face
*
* @param primaryFace which will be new primary face
* @throws IllegalArgumentException when argument primaryFace is null
*/
public
void
setPrimaryFace
(
HumanFace
primaryFace
)
{
if
(
primaryFace
==
null
)
{
throw
new
IllegalArgumentException
(
"Primary face is null"
);
}
this
.
primaryFace
=
primaryFace
;
}
/**
* returns list of HumanFace secondary faces
* @return list of secondary faces in project
* Returns list of HumanFace secondary faces
*
* @return list of secondary faces
*/
public
List
<
HumanFace
>
getSecondaryFaces
()
{
return
Collections
.
unmodifiableList
(
secondaryFaces
);
...
...
@@ -42,27 +49,45 @@ public class Project {
/**
* Sets new list of secondary faces
*
* @param secondaryFaces list of HumanFace which will be new list of
* secondary faces
* @throws IllegalArgumentException if one of faces from argument is null
*/
public
void
setSecondaryFaces
(
List
<
HumanFace
>
secondaryFaces
)
{
this
.
secondaryFaces
.
clear
();
for
(
int
i
=
0
;
i
<
secondaryFaces
.
size
();
i
++)
{
if
(
secondaryFaces
.
get
(
i
)
==
null
)
{
throw
new
IllegalArgumentException
(
"One of faces is null"
);
}
}
this
.
secondaryFaces
.
addAll
(
secondaryFaces
);
}
/**
* Adds new face to secondaryFaces
*
* @param face HumanFace which will be added to list of secondary faces
* @throws IllegalArgumentException when argument face is null
*/
public
void
addSecondaryFace
(
HumanFace
face
)
{
if
(
face
==
null
)
{
throw
new
IllegalArgumentException
(
"Face is null"
);
}
this
.
secondaryFaces
.
add
(
face
);
}
/**
* Removes HumanFace from secondaryFaces
*
* @param face HumanFace which will be removed from secondaryFaces
* @throws IllegalArgumentException when argument face is null
*/
public
void
removeSecondaryFace
(
HumanFace
face
)
{
if
(
face
==
null
)
{
throw
new
IllegalArgumentException
(
"Face is null"
);
}
for
(
int
i
=
0
;
i
<
secondaryFaces
.
size
();
i
++)
{
if
(
secondaryFaces
.
get
(
i
).
equals
(
face
))
{
secondaryFaces
.
remove
(
i
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment