Code cleanup (#1461)
* Code cleanup * Fix flux tests * Fix checkstyle errors * Fix compile error
This commit is contained in:
@ -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;
|
||||
|
@ -28,6 +28,6 @@ package com.iluwatar.flux.action;
|
||||
*/
|
||||
public enum ActionType {
|
||||
|
||||
MENU_ITEM_SELECTED, CONTENT_CHANGED;
|
||||
MENU_ITEM_SELECTED, CONTENT_CHANGED
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user