All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.inugami.commons.marshaling.YamlMarshallerError Maven / Gradle / Ivy

There is a newer version: 3.3.5
Show newest version
package io.inugami.commons.marshaling;

import io.inugami.api.exceptions.DefaultErrorCode;
import io.inugami.api.exceptions.ErrorCode;

import static io.inugami.api.exceptions.DefaultErrorCode.newBuilder;

public enum YamlMarshallerError implements ErrorCode {
    YAML_CLASS_REQUIRED(newBuilder()
                                .statusCode(500)
                                .errorCode("YAML-0_0")
                                .message("class is required to unmarshalling yaml to object")),

    YAML_UNMARSHALLING_ERROR(newBuilder()
                                     .statusCode(500)
                                     .errorCode("YAML-0_1")
                                     .message("Yaml can's unmarshall current yaml")),
    YAML_OBJECT_REQUIRED(newBuilder()
                                 .statusCode(500)
                                 .errorCode("YAML-0_2")
                                 .message("object required to serialize as Yaml")),
    YAML_MARSHALLING_ERROR(newBuilder()
                                   .statusCode(500)
                                   .errorCode("YAML-0_3")
                                   .message("can't convert object to Yaml"));
    // =========================================================================
    // ATTRIBUTES
    // =========================================================================
    private final ErrorCode errorCode;

    // =========================================================================
    // CONSTRUCTORS
    // =========================================================================
    private YamlMarshallerError(final DefaultErrorCode.DefaultErrorCodeBuilder builder) {
        errorCode = builder.build();
    }

    // =========================================================================
    // API
    // =========================================================================
    @Override
    public ErrorCode getCurrentErrorCode() {
        return errorCode;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy