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

com.kenshoo.pl.entity.EntityChangeResult Maven / Gradle / Ivy

package com.kenshoo.pl.entity;

import com.google.common.collect.ImmutableList;

import java.util.Collection;
import java.util.Collections;

public abstract class EntityChangeResult, ID extends Identifier, C extends ChangeEntityCommand> {

    private final C command;
    private final Collection errors;

    public EntityChangeResult(C command) {
        this(command, Collections.emptyList());
    }

    public EntityChangeResult(C command, Iterable errors) {
        this.command = command;
        this.errors = ImmutableList.copyOf(errors);
    }

    public C getCommand() {
        return command;
    }

    public boolean isSuccess() {
        return errors.isEmpty();
    }

    public Collection getErrors() {
        return errors;
    }

    public abstract ID getIdentifier();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy