diff --git a/checkstyle.xml b/checkstyle.xml
index e55e137..d11576f 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -28,16 +28,16 @@
-
+
-
+
-
+
@@ -116,13 +116,13 @@
-
+
-
+
diff --git a/pom.xml b/pom.xml
index d985f04..e28d466 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,92 +1,97 @@
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.7.3
-
-
- io.patriot-framework
- virtual-smart-home-plus
- 0.0.1-SNAPSHOT
- virtual-smart-home-plus
- Demo project for Spring Boot
-
- 17
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.apache.commons
- commons-lang3
-
-
- org.modelmapper
- modelmapper
- 3.1.1
-
-
- org.projectlombok
- lombok
- 1.18.26
- provided
-
-
- org.springframework.boot
- spring-boot-starter-validation
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
-
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.3
+
+
+ io.patriot-framework
+ virtual-smart-home-plus
+ 0.0.1-SNAPSHOT
+ virtual-smart-home-plus
+ Demo project for Spring Boot
+
+ 17
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.apache.commons
+ commons-lang3
+
+
+ org.modelmapper
+ modelmapper
+ 3.1.1
+
+
+ org.projectlombok
+ lombok
+ 1.18.26
+ provided
+
+
+ io.patriot-framework
+ generator
+ 2.0.1-SNAPSHOT
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
-
+
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- 3.2.0
-
-
- com.puppycrawl.tools
- checkstyle
- 10.5.0
-
-
-
- checkstyle.xml
-
-
-
- checkstyle
- validate
-
- check
-
-
- true
- false
-
-
-
-
-
-
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.2.0
+
+
+ com.puppycrawl.tools
+ checkstyle
+ 10.5.0
+
+
+
+ checkstyle.xml
+
+
+
+ checkstyle
+ validate
+
+ check
+
+
+ true
+ false
+
+
+
+
+
+
diff --git a/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/APIError.java b/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/APIError.java
index c2130ab..0c98bd7 100644
--- a/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/APIError.java
+++ b/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/APIError.java
@@ -4,6 +4,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.http.HttpStatus;
+
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@@ -14,15 +15,16 @@
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class APIError {
- private HttpStatus status;
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
- private LocalDateTime timestamp;
private final String message;
+ private final HttpStatus status;
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
+ private final LocalDateTime timestamp;
private List subErrors;
/**
* Constructs instance of APIError with current time, error message and
- * @param status status for the recipient
+ *
+ * @param status status for the recipient
* @param message message for the recipient
*/
public APIError(HttpStatus status, String message) {
@@ -33,10 +35,11 @@ public APIError(HttpStatus status, String message) {
/**
* Adds instance of APISubError to the list of errors which caused this error
+ *
* @param error another sub-error which caused error
*/
public void addSubError(APISubError error) {
- if(subErrors == null) {
+ if (subErrors == null) {
subErrors = new ArrayList<>();
}
subErrors.add(error);
diff --git a/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/NotValidSubError.java b/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/NotValidSubError.java
index 222836c..def20c5 100644
--- a/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/NotValidSubError.java
+++ b/src/main/java/io/patriotframework/virtualsmarthomeplus/APIErrors/NotValidSubError.java
@@ -13,22 +13,23 @@ public class NotValidSubError extends APISubError {
/**
* object name
*/
- private String object;
+ private final String object;
/**
* field where the error occurs
*/
- private String field;
+ private final String field;
/**
* rejected value
*/
- private Object rejectedValue;
+ private final Object rejectedValue;
/**
* default message what causes the error
*/
- private String message;
+ private final String message;
/**
* Creates instance of NotValidSubError with initialized attributes. Values are parsed from FieldError
+ *
* @param fieldError instance of FieldError
*/
public NotValidSubError(FieldError fieldError) {
diff --git a/src/main/java/io/patriotframework/virtualsmarthomeplus/APIExceptionHandler.java b/src/main/java/io/patriotframework/virtualsmarthomeplus/APIExceptionHandler.java
index 956c2ac..fe3394d 100644
--- a/src/main/java/io/patriotframework/virtualsmarthomeplus/APIExceptionHandler.java
+++ b/src/main/java/io/patriotframework/virtualsmarthomeplus/APIExceptionHandler.java
@@ -19,23 +19,24 @@ public class APIExceptionHandler extends ResponseEntityExceptionHandler {
/**
* Returns proper response entity on MethodArgumentNotValidException.
- * @param ex exception which caused this method call
+ *
+ * @param ex exception which caused this method call
* @param headers http headers
- * @param status http status
+ * @param status http status
* @param request web request
* @return {@link io.patriotframework.virtualsmarthomeplus.APIErrors.APIError APIError} instance whith list of
- * {@link io.patriotframework.virtualsmarthomeplus.APIErrors.NotValidSubError NotValidSubError} instances, which
- * informs about specific validity violations
+ * {@link io.patriotframework.virtualsmarthomeplus.APIErrors.NotValidSubError NotValidSubError} instances, which
+ * informs about specific validity violations
*/
@Override
protected ResponseEntity