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

org.yamcs.InvalidIdentification Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import org.yamcs.protobuf.Yamcs.NamedObjectId;

@SuppressWarnings("serial")
public class InvalidIdentification extends Exception {

    private List invalidParameters;

    public InvalidIdentification(List paraList) {
        this.invalidParameters = paraList;
    }

    public InvalidIdentification() {
    }

    public InvalidIdentification(NamedObjectId paraId) {
        this.invalidParameters = new ArrayList<>(1);
        getInvalidParameters().add(paraId);
    }

    public List getInvalidParameters() {
        return invalidParameters;
    }

    @Override
    public String getMessage() {
        if (invalidParameters != null) {
            return invalidParameters.stream()
                    .map(NamedObjectId::toString)
                    .collect(Collectors.joining(", "));
        }
        return super.getMessage();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy