Skip to content

Commit d1d49e8

Browse files
committed
metafacture-javaintegration/ (main): Fix Checkstyle violations.
1 parent 635f84f commit d1d49e8

37 files changed

+249
-233
lines changed

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/Collector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.javaintegration;
1718

1819
import java.util.Collection;
@@ -25,7 +26,7 @@
2526
* @author Markus Michael Geipel
2627
*
2728
*/
28-
public interface Collector <V> {
29+
public interface Collector<V> {
2930

3031
Collection<V> getCollection();
3132

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/EventList.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.javaintegration;
1718

19+
import org.metafacture.framework.StreamReceiver;
20+
1821
import java.util.ArrayList;
1922
import java.util.Collections;
2023
import java.util.List;
2124

22-
import org.metafacture.framework.StreamReceiver;
23-
2425
/**
2526
* Stores the received stream events in a list.
2627
*
@@ -33,6 +34,9 @@ public final class EventList implements StreamReceiver {
3334

3435
private boolean closed;
3536

37+
public EventList() {
38+
}
39+
3640
public List<Event> getEvents() {
3741
return Collections.unmodifiableList(events);
3842
}
@@ -131,7 +135,7 @@ public String toString() {
131135
final StringBuilder builder = new StringBuilder();
132136
builder.append(type);
133137
if (name != null) {
134-
builder.append("(" );
138+
builder.append("(");
135139
builder.append(name);
136140
if (value != null) {
137141
builder.append("=");

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.metafacture.javaintegration;
1716

18-
import java.util.Map;
17+
package org.metafacture.javaintegration;
1918

2019
import org.metafacture.framework.FluxCommand;
2120
import org.metafacture.framework.StandardEventNames;
@@ -24,6 +23,8 @@
2423
import org.metafacture.framework.annotations.Out;
2524
import org.metafacture.framework.helpers.DefaultObjectPipe;
2625

26+
import java.util.Map;
27+
2728
/**
2829
* Emits a {@link Map} as a record with a literal for each entry in the map.
2930
* When receiving an empty map only a <i>start-record</i> and <i>end-record</i>
@@ -59,11 +60,13 @@
5960
@In(Map.class)
6061
@Out(StreamReceiver.class)
6162
@FluxCommand("map-to-stream")
62-
public final class MapToStream extends
63-
DefaultObjectPipe<Map<?, ?>, StreamReceiver> {
63+
public final class MapToStream extends DefaultObjectPipe<Map<?, ?>, StreamReceiver> {
6464

6565
private Object idKey = StandardEventNames.ID;
6666

67+
public MapToStream() {
68+
}
69+
6770
/**
6871
* Sets the key of the map entry that is used for the record id.
6972
* <p>
@@ -88,7 +91,8 @@ public void process(final Map<?, ?> map) {
8891
final Object id = map.get(idKey);
8992
if (id == null) {
9093
getReceiver().startRecord("");
91-
} else {
94+
}
95+
else {
9296
getReceiver().startRecord(id.toString());
9397
}
9498
for (final Map.Entry<?, ?> entry: map.entrySet()) {

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,34 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.javaintegration;
1718

19+
import org.metafacture.commons.types.NamedValue;
20+
import org.metafacture.framework.helpers.DefaultStreamReceiver;
21+
1822
import java.util.ArrayList;
1923
import java.util.Collection;
2024
import java.util.Iterator;
2125
import java.util.List;
2226
import java.util.ListIterator;
2327

24-
import org.metafacture.commons.types.NamedValue;
25-
import org.metafacture.framework.helpers.DefaultStreamReceiver;
26-
27-
2828
/**
2929
* Collects the received results in a {@link List}.
3030
*
3131
* @author Markus Michael Geipel
3232
*
3333
*/
34-
public final class NamedValueList extends DefaultStreamReceiver
35-
implements List<NamedValue>, Collector<List<NamedValue>> {
34+
public final class NamedValueList extends DefaultStreamReceiver implements List<NamedValue>, Collector<List<NamedValue>> {
3635

3736
private Collection<List<NamedValue>> collection;
3837
private List<NamedValue> list;
3938

4039
public NamedValueList() {
41-
super();
4240
list = new ArrayList<NamedValue>();
4341
}
4442

4543
public NamedValueList(final Collection<List<NamedValue>> collection) {
46-
super();
4744
list = new ArrayList<NamedValue>();
4845
this.collection = collection;
4946
}
@@ -83,36 +80,44 @@ public boolean add(final NamedValue element) {
8380
return list.add(element);
8481
}
8582

83+
@Override
84+
public void add(final int index, final NamedValue element) {
85+
list.add(index, element);
86+
}
87+
8688
@Override
8789
public boolean remove(final Object object) {
8890
return list.remove(object);
8991
}
9092

9193
@Override
92-
public boolean containsAll(final Collection<?> collection) {
93-
return list.containsAll(collection);
94+
public NamedValue remove(final int index) {
95+
return list.remove(index);
9496
}
9597

9698
@Override
97-
public boolean addAll(final Collection<? extends NamedValue> collection) {
98-
return list.addAll(collection);
99+
public boolean containsAll(final Collection<?> currentCollection) {
100+
return list.containsAll(currentCollection);
99101
}
100102

101103
@Override
102-
public boolean addAll(final int index, final Collection<? extends NamedValue> collection) {
103-
return list.addAll(index, collection);
104+
public boolean addAll(final Collection<? extends NamedValue> currentCollection) {
105+
return list.addAll(currentCollection);
104106
}
105107

106108
@Override
107-
public boolean removeAll(final Collection<?> collection) {
108-
109-
return list.removeAll(collection);
109+
public boolean addAll(final int index, final Collection<? extends NamedValue> currentCollection) {
110+
return list.addAll(index, currentCollection);
110111
}
111112

112113
@Override
113-
public boolean retainAll(final Collection<?> collection) {
114+
public boolean removeAll(final Collection<?> currentCollection) {
115+
return list.removeAll(currentCollection);
116+
}
114117

115-
return list.retainAll(collection);
118+
@Override
119+
public boolean retainAll(final Collection<?> currentCollection) {
120+
return list.retainAll(currentCollection);
116121
}
117122

118123
@Override
@@ -130,16 +135,6 @@ public NamedValue set(final int index, final NamedValue element) {
130135
return list.set(index, element);
131136
}
132137

133-
@Override
134-
public void add(final int index, final NamedValue element) {
135-
list.add(index, element);
136-
}
137-
138-
@Override
139-
public NamedValue remove(final int index) {
140-
return list.remove(index);
141-
}
142-
143138
@Override
144139
public int indexOf(final Object object) {
145140
return list.indexOf(object);
@@ -166,7 +161,7 @@ public List<NamedValue> subList(final int fromIndex, final int toIndex) {
166161
}
167162

168163
@Override
169-
public void startRecord(final String identifier){
164+
public void startRecord(final String identifier) {
170165
list.clear();
171166
}
172167

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,29 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.javaintegration;
1718

19+
import org.metafacture.commons.types.NamedValue;
20+
import org.metafacture.framework.helpers.DefaultStreamReceiver;
21+
1822
import java.util.Collection;
1923
import java.util.HashSet;
2024
import java.util.Iterator;
2125
import java.util.Set;
2226

23-
import org.metafacture.commons.types.NamedValue;
24-
import org.metafacture.framework.helpers.DefaultStreamReceiver;
25-
26-
2727
/**
2828
* Collects {@link NamedValue}s in a {@link Set}. So there will not be
2929
* duplicates.
3030
*
3131
* @author Markus Michael Geipel
3232
*/
33-
public final class NamedValueSet extends DefaultStreamReceiver
34-
implements Set<NamedValue>, Collector<Set<NamedValue>> {
33+
public final class NamedValueSet extends DefaultStreamReceiver implements Set<NamedValue>, Collector<Set<NamedValue>> {
3534

3635
private Collection<Set<NamedValue>> collection;
3736
private Set<NamedValue> set;
3837

3938
public NamedValueSet() {
40-
super();
4139
set = new HashSet<>();
4240
this.collection = null;
4341

@@ -50,7 +48,6 @@ public NamedValueSet() {
5048
* @param collection is filled with the received results.
5149
*/
5250
public NamedValueSet(final Collection<Set<NamedValue>> collection) {
53-
super();
5451
set = new HashSet<>();
5552
this.collection = collection;
5653
}

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ObjectCollector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.javaintegration;
1718

19+
import org.metafacture.framework.ObjectReceiver;
20+
1821
import java.util.LinkedList;
1922
import java.util.Queue;
2023

21-
import org.metafacture.framework.ObjectReceiver;
22-
2324
/**
2425
* Collects the objects emitted by an upstream module.
2526
*
@@ -40,7 +41,6 @@ public ObjectCollector() {
4041
}
4142

4243
public ObjectCollector(final int maxCapacity) {
43-
super();
4444
this.maxCapacity = maxCapacity;
4545
}
4646

metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/SingleValue.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,29 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.metafacture.javaintegration;
1716

18-
import java.util.Collection;
17+
package org.metafacture.javaintegration;
1918

2019
import org.metafacture.framework.helpers.DefaultStreamReceiver;
2120

21+
import java.util.Collection;
2222

2323
/**
2424
* just records the value of the last received literal.
2525
* @author Markus Michael Geipel
2626
*
2727
*/
28-
public final class SingleValue extends DefaultStreamReceiver
29-
implements Collector<String> {
28+
public final class SingleValue extends DefaultStreamReceiver implements Collector<String> {
3029

3130
private boolean closed;
3231
private String value = "";
3332
private Collection<String> collection;
3433

3534
public SingleValue() {
36-
super();
3735
collection = null;
3836
}
3937

4038
public SingleValue(final Collection<String> collection) {
41-
super();
4239
this.collection = collection;
4340
}
4441

@@ -72,9 +69,9 @@ public void endRecord() {
7269
}
7370

7471
@Override
75-
public void literal(final String name, final String value) {
72+
public void literal(final String name, final String newValue) {
7673
assert !closed;
77-
this.setValue(value);
74+
setValue(newValue);
7875
}
7976

8077
@Override

0 commit comments

Comments
 (0)