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

@ -33,11 +33,11 @@ import com.iluwatar.specification.property.Size;
*/
public abstract class AbstractCreature implements Creature {
private String name;
private Size size;
private Movement movement;
private Color color;
private Mass mass;
private final String name;
private final Size size;
private final Movement movement;
private final Color color;
private final Mass mass;
/**
* Constructor.

View File

@ -30,7 +30,7 @@ public enum Color {
DARK("dark"), LIGHT("light"), GREEN("green"), RED("red");
private String title;
private final String title;
Color(String title) {
this.title = title;

View File

@ -28,8 +28,8 @@ package com.iluwatar.specification.property;
*/
public class Mass {
private double value;
private String title;
private final double value;
private final String title;
public Mass(double value) {
this.value = value;

View File

@ -30,7 +30,7 @@ public enum Movement {
WALKING("walking"), SWIMMING("swimming"), FLYING("flying");
private String title;
private final String title;
Movement(String title) {
this.title = title;

View File

@ -30,7 +30,7 @@ public enum Size {
SMALL("small"), NORMAL("normal"), LARGE("large");
private String title;
private final String title;
Size(String title) {
this.title = title;

View File

@ -30,7 +30,7 @@ import java.util.List;
*/
public class ConjunctionSelector<T> extends AbstractSelector<T> {
private List<AbstractSelector<T>> leafComponents;
private final List<AbstractSelector<T>> leafComponents;
@SafeVarargs
ConjunctionSelector(AbstractSelector<T>... selectors) {

View File

@ -30,7 +30,7 @@ import java.util.List;
*/
public class DisjunctionSelector<T> extends AbstractSelector<T> {
private List<AbstractSelector<T>> leafComponents;
private final List<AbstractSelector<T>> leafComponents;
@SafeVarargs
DisjunctionSelector(AbstractSelector<T>... selectors) {

View File

@ -30,7 +30,7 @@ package com.iluwatar.specification.selector;
*/
public class NegationSelector<T> extends AbstractSelector<T> {
private AbstractSelector<T> component;
private final AbstractSelector<T> component;
NegationSelector(AbstractSelector<T> selector) {
this.component = selector;