Skip to content

Commit 47297f8

Browse files
author
a-brandt
committed
fixed sonarlint issue
1 parent ccf47e2 commit 47297f8

File tree

5 files changed

+89
-126
lines changed

5 files changed

+89
-126
lines changed

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

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -61,44 +61,6 @@ public BaseDocument(String documentKey) {
6161
this.documentKey = documentKey;
6262
}
6363

64-
// /**
65-
// * @param keyValues a set of key/value pairs containing the attributes for
66-
// the document.
67-
// * The length has to be even and each even entry has to be of type String.
68-
// * If not an empty document will be created
69-
// */
70-
// public BaseDocument(Object ...keyValues) {
71-
// this(null, keyValues);
72-
// }
73-
//
74-
// /**
75-
// * create a BaseDocument with a given key and attributes defined in
76-
// keyValues
77-
// *
78-
// * @param documentKey the unique key of the document
79-
// * @param keyValues a set of key/value pairs containing the attributes for
80-
// the document.
81-
// * The length has to be even and each even entry has to be of type String.
82-
// * If not an empty document will be created
83-
// */
84-
// public BaseDocument(String documentKey, Object ...keyValues) {
85-
// this.init();
86-
// if (documentKey != null) {
87-
// this.documentKey = documentKey;
88-
// }
89-
// if (checkKeyValues(keyValues)) {
90-
// for (int i = 0; i < keyValues.length; i = i+2) {
91-
// if (keyValues[i] == REV) {
92-
// this.documentRevision = (Long) keyValues[i+1];
93-
// } else if (keyValues[i] == KEY && documentKey == null) {
94-
// this.documentKey = (String) keyValues[i+1];
95-
// } else {
96-
// this.addAttribute((String) keyValues[i], keyValues[i + 1]);
97-
// }
98-
// }
99-
// }
100-
// }
101-
10264
/**
10365
* create an BaseDocument with given attributes
10466
*
@@ -221,23 +183,4 @@ public String toString() {
221183
+ ", documentKey=" + documentKey + ", properties=" + properties + "]";
222184
}
223185

224-
// /**
225-
// * check the list if it is suitable
226-
// *
227-
// * @param keyValues
228-
// * @return true, if the list has an even number and is an alternating
229-
// sequence of instances of String and Object.
230-
// */
231-
// private boolean checkKeyValues(Object... keyValues) {
232-
// if (keyValues.length %2 != 0) {
233-
// return false;
234-
// }
235-
// for (int i = 0; i < keyValues.length; i = i+2) {
236-
// if (! (keyValues[i] instanceof String)) {
237-
// return false;
238-
// }
239-
// }
240-
// return true;
241-
// }
242-
243186
}

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

Lines changed: 61 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,54 +30,66 @@
3030
*/
3131
public abstract class BaseMapEntity<K, V> extends BaseEntity implements Map<K, V> {
3232

33-
private final TreeMap<K, V> innerMap = new TreeMap<K, V>();
33+
private final TreeMap<K, V> innerMap = new TreeMap<K, V>();
34+
35+
@Override
36+
public int size() {
37+
return innerMap.size();
38+
}
39+
40+
@Override
41+
public boolean isEmpty() {
42+
return innerMap.isEmpty();
43+
}
44+
45+
@Override
46+
public boolean containsKey(Object key) {
47+
return innerMap.containsKey(key);
48+
}
49+
50+
@Override
51+
public boolean containsValue(Object value) {
52+
return innerMap.containsValue(value);
53+
}
54+
55+
@Override
56+
public V get(Object key) {
57+
return innerMap.get(key);
58+
}
59+
60+
@Override
61+
public V put(K key, V value) {
62+
return innerMap.put(key, value);
63+
}
64+
65+
@Override
66+
public V remove(Object key) {
67+
return innerMap.remove(key);
68+
}
69+
70+
@Override
71+
public void putAll(Map<? extends K, ? extends V> t) {
72+
innerMap.putAll(t);
73+
}
74+
75+
@Override
76+
public void clear() {
77+
innerMap.clear();
78+
}
79+
80+
@Override
81+
public Set<K> keySet() {
82+
return innerMap.keySet();
83+
}
84+
85+
@Override
86+
public Collection<V> values() {
87+
return innerMap.values();
88+
}
89+
90+
@Override
91+
public Set<java.util.Map.Entry<K, V>> entrySet() {
92+
return innerMap.entrySet();
93+
}
3494

35-
public int size() {
36-
return innerMap.size();
37-
}
38-
39-
public boolean isEmpty() {
40-
return innerMap.isEmpty();
41-
}
42-
43-
public boolean containsKey(Object key) {
44-
return innerMap.containsKey(key);
45-
}
46-
47-
public boolean containsValue(Object value) {
48-
return innerMap.containsValue(value);
49-
}
50-
51-
public V get(Object key) {
52-
return innerMap.get(key);
53-
}
54-
55-
public V put(K key, V value) {
56-
return innerMap.put(key, value);
57-
}
58-
59-
public V remove(Object key) {
60-
return innerMap.remove(key);
61-
}
62-
63-
public void putAll(Map<? extends K, ? extends V> t) {
64-
innerMap.putAll(t);
65-
}
66-
67-
public void clear() {
68-
innerMap.clear();
69-
}
70-
71-
public Set<K> keySet() {
72-
return innerMap.keySet();
73-
}
74-
75-
public Collection<V> values() {
76-
return innerMap.values();
77-
}
78-
79-
public Set<java.util.Map.Entry<K, V>> entrySet() {
80-
return innerMap.entrySet();
81-
}
82-
8395
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@ public class DocumentEntity<T> extends BaseEntity implements DocumentHolder {
4545
T entity;
4646

4747
public DocumentEntity() {
48+
// do nothing here
4849
}
4950

51+
@Override
5052
public long getDocumentRevision() {
5153
return documentRevision;
5254
}
5355

56+
@Override
5457
public String getDocumentHandle() {
5558
return documentHandle;
5659
}
@@ -59,10 +62,12 @@ public T getEntity() {
5962
return entity;
6063
}
6164

65+
@Override
6266
public void setDocumentRevision(long documentRevision) {
6367
this.documentRevision = documentRevision;
6468
}
6569

70+
@Override
6671
public void setDocumentHandle(String documentHandle) {
6772
this.documentHandle = documentHandle;
6873
}
@@ -71,10 +76,12 @@ public void setEntity(T entity) {
7176
this.entity = entity;
7277
}
7378

79+
@Override
7480
public String getDocumentKey() {
7581
return documentKey;
7682
}
7783

84+
@Override
7885
public void setDocumentKey(String documentKey) {
7986
this.documentKey = documentKey;
8087
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class DocumentsEntity extends BaseEntity implements Iterable<String> {
3434
*/
3535
List<String> documents;
3636

37+
@Override
3738
public Iterator<String> iterator() {
3839
return CollectionUtils.safetyIterator(documents);
3940
}

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@
2525
*/
2626
public class StreamEntity extends BaseEntity {
2727

28-
public StreamEntity() {
29-
30-
}
31-
32-
public StreamEntity(InputStream stream) {
33-
this.stream = stream;
34-
}
35-
36-
/**
37-
* Input stream.
38-
*/
39-
InputStream stream;
40-
41-
public InputStream getStream() {
42-
return stream;
43-
}
44-
45-
public void setStream(InputStream stream) {
46-
this.stream = stream;
47-
}
28+
/**
29+
* Input stream.
30+
*/
31+
InputStream stream;
32+
33+
public StreamEntity() {
34+
// do nothing here
35+
}
36+
37+
public StreamEntity(InputStream stream) {
38+
this.stream = stream;
39+
}
40+
41+
public InputStream getStream() {
42+
return stream;
43+
}
44+
45+
public void setStream(InputStream stream) {
46+
this.stream = stream;
47+
}
4848

4949
}

0 commit comments

Comments
 (0)