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

ai.stapi.graphoperations.synchronization.nodeIdentificator.exception.InvalidNodeIdentificator Maven / Gradle / Ivy

There is a newer version: 0.3.2
Show newest version
package ai.stapi.graphoperations.synchronization.nodeIdentificator.exception;

import ai.stapi.graphoperations.graphLanguage.graphDescription.specific.positive.PositiveGraphDescription;
import ai.stapi.utils.Stringifier;
import java.util.List;
import java.util.stream.Collectors;

public class InvalidNodeIdentificator extends RuntimeException {

    private InvalidNodeIdentificator(String becauseMessage) {
        super("Node identificator was invalid, because " + becauseMessage);
    }
    
    public static InvalidNodeIdentificator becausePathToIdentifiactionValueDoesntStartWithEdgeOrAttributeDescription(
        List invalidPaths
    ) {
        return new InvalidNodeIdentificator(
            String.format(
                "path to identification value does not start with edge or attribute description. Invalid paths: %n%s",
                invalidPaths.stream().map(Stringifier::convertToString).collect(Collectors.joining("\n"))
            )
        );
    }

    public static InvalidNodeIdentificator becausePathToIdentifiactionValueIsNotSinglePath(
        List invalidPaths
    ) {
        return new InvalidNodeIdentificator(
            String.format(
                "path to identification value is not single path. Invalid paths: %n%s",
                invalidPaths.stream().map(Stringifier::convertToString).collect(Collectors.joining("\n"))
            )
        );
    }

    public static InvalidNodeIdentificator becausePathToIdentifiactionValueIsNotEndingWithUuidIdentityOrAttributeDescription(
        List invalidPaths
    ) {
        return new InvalidNodeIdentificator(
            String.format(
                "path to identification value is not ending with uuid identity or attribute description. " +
                    "Invalid paths: %n%s",
                invalidPaths.stream().map(Stringifier::convertToString).collect(Collectors.joining("\n"))
            )
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy