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

io.sphere.internal.util.ValidationE Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.internal.util;

import io.sphere.client.SphereClientException;
import net.jcip.annotations.Immutable;

/** Validation with the error type being {@link io.sphere.client.SphereClientException}. */
@Immutable
public final class ValidationE extends Validation {
    private ValidationE(T value, SphereClientException exception) {
        super(value, exception);
    }

    /** Creates a new successful result. */
    public static  ValidationE success(T value) {
        return new ValidationE(value, null);
    }

    /** Creates a new erroneous result. */
    public static  ValidationE error(SphereClientException exception) {
        return new ValidationE(null, exception);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy