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

com.github.dockerjava.api.model.LoadResponseItem Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
package com.github.dockerjava.api.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class LoadResponseItem extends ResponseItem {

    private static final long serialVersionUID = 1L;

    private static final String IMPORT_SUCCESS = "Loaded image:";

    /**
     * Returns whether the stream field indicates a successful build operation
     */
    @JsonIgnore
    public boolean isBuildSuccessIndicated() {
        if (isErrorIndicated() || getStream() == null) {
            return false;
        }

        return getStream().contains(IMPORT_SUCCESS);
    }

    @JsonIgnore
    public String getMessage() {
        if (!isBuildSuccessIndicated()) {
            return null;
        } else if (getStream().contains(IMPORT_SUCCESS)) {
            return getStream();
        }

        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy