Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2159f24

Browse files
committedMay 13, 2025
iluwatar#1263 apply spotless
1 parent 3e1263e commit 2159f24

File tree

8 files changed

+22
-33
lines changed

8 files changed

+22
-33
lines changed
 

‎view-helper/src/main/java/com/iluwatar/viewhelper/App.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
package com.iluwatar.viewhelper;
2727

28-
2928
import java.math.BigDecimal;
3029
import java.time.LocalDate;
3130

@@ -38,16 +37,13 @@ public class App {
3837
*/
3938
public static void main(String[] args) {
4039
// Raw Product data (no formatting, no UI tags)
41-
var product = new Product(
42-
"Design patterns book",
43-
new BigDecimal("18.90"),
44-
LocalDate.of(2025, 4, 19),
45-
true
46-
);
40+
var product =
41+
new Product(
42+
"Design patterns book", new BigDecimal("18.90"), LocalDate.of(2025, 4, 19), true);
4743

4844
// Create view, viewHelper and viewHelper
49-
var helper = new ProductViewHelper();
50-
var view = new ConsoleProductView();
45+
var helper = new ProductViewHelper();
46+
var view = new ConsoleProductView();
5147
var controller = new ProductController(helper, view);
5248

5349
// Handle “request”

‎view-helper/src/main/java/com/iluwatar/viewhelper/ConsoleProductView.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626

2727
import lombok.extern.slf4j.Slf4j;
2828

29-
/**
30-
* Renders {@link ProductViewModel} to the console.
31-
*/
29+
/** Renders {@link ProductViewModel} to the console. */
3230
@Slf4j
3331
public class ConsoleProductView implements View<ProductViewModel> {
3432
@Override

‎view-helper/src/main/java/com/iluwatar/viewhelper/Product.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,5 @@
2727
import java.math.BigDecimal;
2828
import java.time.LocalDate;
2929

30-
/**
31-
* Definition of product.
32-
*/
33-
34-
public record Product(String name, BigDecimal price, LocalDate releaseDate, boolean discounted) {
35-
}
30+
/** Definition of product. */
31+
public record Product(String name, BigDecimal price, LocalDate releaseDate, boolean discounted) {}

‎view-helper/src/main/java/com/iluwatar/viewhelper/ProductController.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,24 @@
2525
package com.iluwatar.viewhelper;
2626

2727
/**
28-
* Controller delegates a {@link Product} to {@link ProductViewHelper} and then to {@link ConsoleProductView}.
28+
* Controller delegates a {@link Product} to {@link ProductViewHelper} and then to {@link
29+
* ConsoleProductView}.
2930
*/
3031
public class ProductController {
3132

3233
private final ViewHelper<Product, ProductViewModel> viewHelper;
3334
private final View<ProductViewModel> view;
3435

35-
public ProductController(ViewHelper<Product, ProductViewModel> viewHelper,
36-
View<ProductViewModel> view) {
36+
public ProductController(
37+
ViewHelper<Product, ProductViewModel> viewHelper, View<ProductViewModel> view) {
3738
this.viewHelper = viewHelper;
3839
this.view = view;
3940
}
4041

41-
/** Passes the product to the helper for formatting and then forwards formatted product to the view. */
42+
/**
43+
* Passes the product to the helper for formatting and then forwards formatted product to the
44+
* view.
45+
*/
4246
public void handle(Product product) {
4347
view.render(viewHelper.prepare(product));
4448
}

‎view-helper/src/main/java/com/iluwatar/viewhelper/ProductViewHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929

3030
import java.text.NumberFormat;
3131

32-
/**
33-
* Formats a {@link Product} into a {@link ProductViewModel}.
34-
*/
32+
/** Formats a {@link Product} into a {@link ProductViewModel}. */
3533
public class ProductViewHelper implements ViewHelper<Product, ProductViewModel> {
3634

3735
private static final String DISCOUNT_TAG = " ON SALE";

‎view-helper/src/main/java/com/iluwatar/viewhelper/ProductViewModel.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,5 @@
2424
*/
2525
package com.iluwatar.viewhelper;
2626

27-
/**
28-
* Class defining formatted display data of a {@link Product}.
29-
*/
30-
public record ProductViewModel(String name, String price, String releasedDate) {
31-
}
27+
/** Class defining formatted display data of a {@link Product}. */
28+
public record ProductViewModel(String name, String price, String releasedDate) {}

‎view-helper/src/main/java/com/iluwatar/viewhelper/View.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
public interface View<V> {
2828

2929
void render(V data);
30-
}
30+
}

‎view-helper/src/test/java/com/iluwatar/viewhelper/ProductViewHelperTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ void shouldFormatProductWithDiscount() {
5555
var product = new Product("X", new BigDecimal("10.00"), LocalDate.of(2025, 1, 1), true);
5656
ProductViewModel viewModel = helper.prepare(product);
5757

58-
assertEquals("X ON SALE", viewModel.name()); // locale follows JVM default
58+
assertEquals("X ON SALE", viewModel.name()); // locale follows JVM default
5959
}
60-
}
60+
}

0 commit comments

Comments
 (0)
Please sign in to comment.