Skip to content

Commit 1cef7bc

Browse files
author
a-brandt
committed
fixed some sonar issues
1 parent 688ff97 commit 1cef7bc

File tree

3 files changed

+40
-43
lines changed

3 files changed

+40
-43
lines changed

src/main/java/com/arangodb/entity/BaseEntity.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public abstract class BaseEntity implements Serializable {
7474
* @return boolean
7575
*/
7676
public boolean isNotModified() {
77-
return statusCode == 304; // HttpStatus.SC_NOT_MODIFIED;
77+
return statusCode == 304;
7878
}
7979

8080
/**
@@ -86,15 +86,6 @@ public boolean isUnauthorized() {
8686
return statusCode == 401;
8787
}
8888

89-
// /**
90-
// * If the requested resource has not been modified it returns true
91-
// *
92-
// * @return boolean
93-
// */
94-
// public boolean isNotFound() {
95-
// return statusCode == 404;
96-
// }
97-
9889
/**
9990
* If this is the response of a batch request it returns true
10091
*

src/main/java/com/arangodb/entity/CollectionType.java

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,36 @@
2323
*
2424
*/
2525
public enum CollectionType {
26-
/**
27-
* Document collection type
28-
*/
29-
DOCUMENT(2),
30-
31-
/**
32-
* Edge collection type, used for graphs
33-
*/
34-
EDGE(3);
35-
private final int type;
36-
private CollectionType(int type) {
37-
this.type = type;
38-
}
39-
public int getType() {
40-
return type;
41-
}
42-
public static CollectionType valueOf(int type) {
43-
switch (type) {
44-
case 2:
45-
return DOCUMENT;
46-
case 3:
47-
return EDGE;
48-
}
49-
return null;
50-
}
26+
/**
27+
* Document collection type
28+
*/
29+
DOCUMENT(2),
30+
31+
/**
32+
* Edge collection type, used for graphs
33+
*/
34+
EDGE(3);
35+
36+
private final int type;
37+
38+
private CollectionType(int type) {
39+
this.type = type;
40+
}
41+
42+
public int getType() {
43+
return type;
44+
}
45+
46+
public static CollectionType valueOf(int type) {
47+
CollectionType result = null;
48+
49+
if (type == 2) {
50+
result = DOCUMENT;
51+
}
52+
else if (type == 3) {
53+
result = EDGE;
54+
}
55+
56+
return result;
57+
}
5158
}

src/main/java/com/arangodb/entity/JobsEntity.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ public class JobsEntity extends BaseEntity {
3030
/**
3131
* The enumeration containing the job state
3232
*/
33-
public static enum JobState {
34-
DONE,
35-
PENDING;
33+
public enum JobState {
34+
DONE, PENDING;
3635
public java.lang.String getName() {
3736
if (this == DONE) {
3837
return "done";
@@ -44,7 +43,11 @@ public java.lang.String getName() {
4443
}
4544
}
4645

47-
List<String> jobs;
46+
private List<String> jobs;
47+
48+
public JobsEntity(List<String> jobs) {
49+
this.jobs = jobs;
50+
}
4851

4952
public List<String> getJobs() {
5053
return jobs;
@@ -53,8 +56,4 @@ public List<String> getJobs() {
5356
public void setJobs(List<String> jobs) {
5457
this.jobs = jobs;
5558
}
56-
57-
public JobsEntity(List<String> jobs) {
58-
this.jobs = jobs;
59-
}
6059
}

0 commit comments

Comments
 (0)