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

com.hp.autonomy.idolutils.processors.AciErrorExceptionBuilder Maven / Gradle / Ivy

/*
 * Copyright 2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.idolutils.processors;


import com.autonomy.aci.client.services.AciErrorException;
import com.hp.autonomy.types.idol.Error;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * Builds error exception from Idol error response
 */
@SuppressWarnings("UseOfObsoleteDateTimeApi")
@Setter
@NoArgsConstructor
@Accessors(chain = true)
public class AciErrorExceptionBuilder {
    private String errorId;
    private String rawErrorId;
    private String errorString;
    private String errorDescription;
    private String errorCode;
    private Date errorTime;

    public AciErrorExceptionBuilder(final Error error) {
        errorId = error.getErrorid();
        rawErrorId = error.getRawerrorid();
        errorString = error.getErrorstring();
        errorDescription = error.getErrordescription();
        errorCode = error.getErrorcode();
        errorTime = error.getErrortime();
    }

    public AciErrorException build() {
        final AciErrorException aciErrorException = new AciErrorException();
        aciErrorException.setErrorId(errorId);
        aciErrorException.setRawErrorId(rawErrorId);
        aciErrorException.setErrorString(errorString);
        aciErrorException.setErrorDescription(errorDescription);
        aciErrorException.setErrorCode(errorCode);
        aciErrorException.setErrorTime(errorTime);
        return aciErrorException;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy