package com.lindar.wellrested.vo;


public class ResultFactory {

    public static <T> Result<T> successful(T data) {
        return Result.<T>builder().success(true).data(data).build();
    }

    public static <T> Result<T> successful(T data, String msg) {
        return Result.<T>builder().success(true).data(data).msg(msg).build();
    }

    public static <T> Result<T> successful(T data, String msg, String code) {
        return Result.<T>builder().success(true).data(data).msg(msg).code(code).build();
    }

    public static <T> Result<T> successfulMsg(String msg) {
        return Result.<T>builder().success(true).msg(msg).build();
    }

    public static <T> Result<T> successful(String msg, String code) {
        return Result.<T>builder().success(true).msg(msg).code(code).build();
    }


    public static <T> Result<T> failed(String msg) {
        return Result.<T>builder().success(false).msg(msg).build();
    }

    public static <T> Result<T> failed(String msg, String code) {
        return Result.<T>builder().success(false).msg(msg).code(code).build();
    }

    public static <T> Result<T> failed(T data, String msg) {
        return Result.<T>builder().success(false).msg(msg).data(data).build();
    }

    public static <T> Result<T> failed(T data, String msg, String code) {
        return Result.<T>builder().success(false).data(data).msg(msg).code(code).build();
    }

    public static <T, U> Result<T> failed(Result<U> anotherResult) {
        return Result.<T>builder().success(false)
                .msg(anotherResult.getMsg())
                .code(anotherResult.getCode())
                .visible(anotherResult.isVisible())
                .build();
    }

    private ResultFactory() {
    }
}
@@ -1742,24 +1742,357 @@
 ;%0D%0A    %7D%0D%0A%0D%0A
+    public static %3CT, U%3E Result%3CT%3E copyWithoutData(Result%3CU%3E anotherResult) %7B%0D%0A        return Result.%3CT%3Ebuilder().success(anotherResult.isSuccess())%0D%0A                .msg(anotherResult.getMsg())%0D%0A                .code(anotherResult.getCode())%0D%0A                .visible(anotherResult.isVisible())%0D%0A                .build();%0D%0A    %7D%0D%0A%0D%0A
     private 

add copyWithoutData method to ObjectsAcolyte