Skip to content

Commit 1e76d91

Browse files
anuragagarwal561994iluwatar
authored andcommitted
Resolves checkstyle errors for abstract-document abstract-factory acyclic-visitor adapter aggregator-microservices (iluwatar#1080)
* Reduces checkstyle errors in abstract-document * Reduces checkstyle errors in abstract-factory * Reduces checkstyle errors in acyclic-visitor * Reduces checkstyle errors in adapter * Reduces checkstyle errors in aggregator-microservices
1 parent 3907951 commit 1e76d91

File tree

50 files changed

+154
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+154
-211
lines changed

abstract-document/src/main/java/com/iluwatar/abstractdocument/AbstractDocument.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.stream.Stream;
3232

3333
/**
34-
* Abstract implementation of Document interface
34+
* Abstract implementation of Document interface.
3535
*/
3636
public abstract class AbstractDocument implements Document {
3737

@@ -64,7 +64,8 @@ public <T> Stream<T> children(String key, Function<Map<String, Object>, T> const
6464
public String toString() {
6565
var builder = new StringBuilder();
6666
builder.append(getClass().getName()).append("[");
67-
properties.forEach((key, value) -> builder.append("[").append(key).append(" : ").append(value).append("]"));
67+
properties.forEach((key, value) -> builder.append("[").append(key).append(" : ").append(value)
68+
.append("]"));
6869
builder.append("]");
6970
return builder.toString();
7071
}

abstract-document/src/main/java/com/iluwatar/abstractdocument/App.java

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,58 +25,56 @@
2525

2626
import com.iluwatar.abstractdocument.domain.Car;
2727
import com.iluwatar.abstractdocument.domain.enums.Property;
28-
import org.slf4j.Logger;
29-
import org.slf4j.LoggerFactory;
30-
3128
import java.util.List;
3229
import java.util.Map;
30+
import org.slf4j.Logger;
31+
import org.slf4j.LoggerFactory;
3332

3433
/**
35-
* The Abstract Document pattern enables handling additional, non-static
36-
* properties. This pattern uses concept of traits to enable type safety and
37-
* separate properties of different classes into set of interfaces.
38-
* <p>
39-
* <p>
40-
* In Abstract Document pattern,({@link AbstractDocument}) fully implements
41-
* {@link Document}) interface. Traits are then defined to enable access to
42-
* properties in usual, static way.
34+
* The Abstract Document pattern enables handling additional, non-static properties. This pattern
35+
* uses concept of traits to enable type safety and separate properties of different classes into
36+
* set of interfaces.
37+
*
38+
* <p>In Abstract Document pattern,({@link AbstractDocument}) fully implements {@link Document})
39+
* interface. Traits are then defined to enable access to properties in usual, static way.
4340
*/
4441
public class App {
4542

4643
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
4744

4845
/**
49-
* Executes the App
46+
* Executes the App.
5047
*/
5148
public App() {
5249
LOGGER.info("Constructing parts and car");
5350

5451
var wheelProperties = Map.of(
55-
Property.TYPE.toString(), "wheel",
56-
Property.MODEL.toString(), "15C",
57-
Property.PRICE.toString(), 100L);
52+
Property.TYPE.toString(), "wheel",
53+
Property.MODEL.toString(), "15C",
54+
Property.PRICE.toString(), 100L);
5855

5956
var doorProperties = Map.of(
60-
Property.TYPE.toString(), "door",
61-
Property.MODEL.toString(), "Lambo",
62-
Property.PRICE.toString(), 300L);
57+
Property.TYPE.toString(), "door",
58+
Property.MODEL.toString(), "Lambo",
59+
Property.PRICE.toString(), 300L);
6360

6461
var carProperties = Map.of(
65-
Property.MODEL.toString(), "300SL",
66-
Property.PRICE.toString(), 10000L,
67-
Property.PARTS.toString(), List.of(wheelProperties, doorProperties));
62+
Property.MODEL.toString(), "300SL",
63+
Property.PRICE.toString(), 10000L,
64+
Property.PARTS.toString(), List.of(wheelProperties, doorProperties));
6865

6966
var car = new Car(carProperties);
7067

7168
LOGGER.info("Here is our car:");
7269
LOGGER.info("-> model: {}", car.getModel().get());
7370
LOGGER.info("-> price: {}", car.getPrice().get());
7471
LOGGER.info("-> parts: ");
75-
car.getParts().forEach(p -> LOGGER.info("\t{}/{}/{}", p.getType().get(), p.getModel().get(), p.getPrice().get()));
72+
car.getParts().forEach(p -> LOGGER
73+
.info("\t{}/{}/{}", p.getType().get(), p.getModel().get(), p.getPrice().get()));
7674
}
7775

7876
/**
79-
* Program entry point
77+
* Program entry point.
8078
*
8179
* @param args command line args
8280
*/

abstract-document/src/main/java/com/iluwatar/abstractdocument/Document.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
import java.util.stream.Stream;
2929

3030
/**
31-
* Document interface
31+
* Document interface.
3232
*/
3333
public interface Document {
3434

3535
/**
36-
* Puts the value related to the key
36+
* Puts the value related to the key.
3737
*
3838
* @param key element key
3939
* @param value element value
@@ -42,15 +42,15 @@ public interface Document {
4242
Void put(String key, Object value);
4343

4444
/**
45-
* Gets the value for the key
45+
* Gets the value for the key.
4646
*
4747
* @param key element key
4848
* @return value or null
4949
*/
5050
Object get(String key);
5151

5252
/**
53-
* Gets the stream of child documents
53+
* Gets the stream of child documents.
5454
*
5555
* @param key element key
5656
* @param constructor constructor of child class

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/Car.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323

2424
package com.iluwatar.abstractdocument.domain;
2525

26-
import java.util.Map;
27-
2826
import com.iluwatar.abstractdocument.AbstractDocument;
27+
import java.util.Map;
2928

3029
/**
31-
* Car entity
30+
* Car entity.
3231
*/
3332
public class Car extends AbstractDocument implements HasModel, HasPrice, HasParts {
3433

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/HasModel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323

2424
package com.iluwatar.abstractdocument.domain;
2525

26-
import java.util.Optional;
27-
2826
import com.iluwatar.abstractdocument.Document;
2927
import com.iluwatar.abstractdocument.domain.enums.Property;
28+
import java.util.Optional;
3029

3130
/**
32-
* HasModel trait for static access to 'model' property
31+
* HasModel trait for static access to 'model' property.
3332
*/
3433
public interface HasModel extends Document {
3534

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/HasParts.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323

2424
package com.iluwatar.abstractdocument.domain;
2525

26-
import java.util.stream.Stream;
27-
2826
import com.iluwatar.abstractdocument.Document;
2927
import com.iluwatar.abstractdocument.domain.enums.Property;
28+
import java.util.stream.Stream;
3029

3130
/**
32-
* HasParts trait for static access to 'parts' property
31+
* HasParts trait for static access to 'parts' property.
3332
*/
3433
public interface HasParts extends Document {
3534

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/HasPrice.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323

2424
package com.iluwatar.abstractdocument.domain;
2525

26-
import java.util.Optional;
27-
2826
import com.iluwatar.abstractdocument.Document;
2927
import com.iluwatar.abstractdocument.domain.enums.Property;
28+
import java.util.Optional;
3029

3130
/**
32-
* HasPrice trait for static access to 'price' property
31+
* HasPrice trait for static access to 'price' property.
3332
*/
3433
public interface HasPrice extends Document {
3534

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/HasType.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323

2424
package com.iluwatar.abstractdocument.domain;
2525

26-
import java.util.Optional;
27-
2826
import com.iluwatar.abstractdocument.Document;
2927
import com.iluwatar.abstractdocument.domain.enums.Property;
28+
import java.util.Optional;
3029

3130
/**
32-
* HasType trait for static access to 'type' property
31+
* HasType trait for static access to 'type' property.
3332
*/
3433
public interface HasType extends Document {
3534

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/Part.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323

2424
package com.iluwatar.abstractdocument.domain;
2525

26-
import java.util.Map;
27-
2826
import com.iluwatar.abstractdocument.AbstractDocument;
27+
import java.util.Map;
2928

3029
/**
31-
* Part entity
30+
* Part entity.
3231
*/
3332
public class Part extends AbstractDocument implements HasType, HasModel, HasPrice {
3433

abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/enums/Property.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
package com.iluwatar.abstractdocument.domain.enums;
2525

2626
/**
27-
*
28-
* Enum To Describe Property type
29-
*
27+
* Enum To Describe Property type.
3028
*/
3129
public enum Property {
3230

0 commit comments

Comments
 (0)