package innovimax.mixthem.rest;

import innovimax.mixthem.rest.request.AlternateMode;
import innovimax.mixthem.rest.request.ZipMode;

import javax.xml.bind.annotation.XmlRootElement;
import javax.ws.rs.core.Response.Status;

@XmlRootElement
public class ErrorResponse {

    private int code;
    private String label;
    private String message;

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getLabel() {
        return this.label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static ErrorResponse createMissingParamTextError() {        
        return createError(Status.BAD_REQUEST, "Text must no be empty!");        
    }

    public static ErrorResponse createMissingParamFileError() {        
        return createError(Status.BAD_REQUEST, "File must no be empty!");        
    }

    public static ErrorResponse createWrongParamAltModeError() {        
        return createError(Status.BAD_REQUEST, "Alternation mode is not valid. Choose a value in " + AlternateMode.printList());
    }

    public static ErrorResponse createWrongParamZipModeError() {
        return createError(Status.BAD_REQUEST, "Zipping mode not is valid. Choose a value in " + ZipMode.printList());
    }

    private static ErrorResponse createError(Status status, String message) {
        ErrorResponse error = new ErrorResponse();
        error.setCode(status.getStatusCode());
        error.setLabel(status.getReasonPhrase());
        error.setMessage(message);
        return error;
    }

}

@@ -30,109 +30,8 @@
 t;%0A%0A
-import innovimax.mixthem.rest.request.AlternateMode;%0Aimport innovimax.mixthem.rest.request.ZipMode;%0A%0A
 impo
@@ -75,16 +75,16 @@
 lement;%0A
+
 import j
@@ -672,736 +672,16 @@
    p
-ublic static ErrorResponse createMissingParamTextError() %7B        %0A        return createError(Status.BAD_REQUEST, %22Text must no be empty!%22);        %0A    %7D%0A%0A    public static ErrorResponse createMissingParamFileError() %7B        %0A        return createError(Status.BAD_REQUEST, %22File must no be empty!%22);        %0A    %7D%0A%0A    public static ErrorResponse createWrongParamAltModeError() %7B        %0A        return createError(Status.BAD_REQUEST, %22Alternation mode is not valid. Choose a value in %22 + AlternateMode.printList());%0A    %7D%0A%0A    public static ErrorResponse createWrongParamZipModeError() %7B%0A        return createError(Status.BAD_REQUEST, %22Zipping mode not is valid. Choose a value in %22 + ZipMode.printList());%0A    %7D%0A%0A    private
+rotected
  sta

Update ErrorResponse.java