Code cleanup (#1461)

* Code cleanup

* Fix flux tests

* Fix checkstyle errors

* Fix compile error
This commit is contained in:
Ilkka Seppälä
2020-07-30 20:28:47 +03:00
committed by GitHub
parent 5381387026
commit 417f21ed3d
243 changed files with 1154 additions and 1162 deletions

View File

@ -28,7 +28,7 @@ package com.iluwatar.flux.action;
*/
public abstract class Action {
private ActionType type;
private final ActionType type;
public Action(ActionType type) {
this.type = type;

View File

@ -28,6 +28,6 @@ package com.iluwatar.flux.action;
*/
public enum ActionType {
MENU_ITEM_SELECTED, CONTENT_CHANGED;
MENU_ITEM_SELECTED, CONTENT_CHANGED
}

View File

@ -31,7 +31,7 @@ public enum Content {
PRODUCTS("Products - This page lists the company's products."), COMPANY(
"Company - This page displays information about the company.");
private String title;
private final String title;
Content(String title) {
this.title = title;

View File

@ -28,7 +28,7 @@ package com.iluwatar.flux.action;
*/
public class ContentAction extends Action {
private Content content;
private final Content content;
public ContentAction(Content content) {
super(ActionType.CONTENT_CHANGED);

View File

@ -29,7 +29,7 @@ package com.iluwatar.flux.action;
*/
public class MenuAction extends Action {
private MenuItem menuItem;
private final MenuItem menuItem;
public MenuAction(MenuItem menuItem) {
super(ActionType.MENU_ITEM_SELECTED);

View File

@ -30,7 +30,7 @@ public enum MenuItem {
HOME("Home"), PRODUCTS("Products"), COMPANY("Company");
private String title;
private final String title;
MenuItem(String title) {
this.title = title;

View File

@ -39,7 +39,7 @@ public final class Dispatcher {
private static Dispatcher instance = new Dispatcher();
private List<Store> stores = new LinkedList<>();
private final List<Store> stores = new LinkedList<>();
private Dispatcher() {
}

View File

@ -33,7 +33,7 @@ import java.util.List;
*/
public abstract class Store {
private List<View> views = new LinkedList<>();
private final List<View> views = new LinkedList<>();
public abstract void onAction(Action action);