Commit 0e49d55f authored by Roland Kluge's avatar Roland Kluge
Browse files

Clean up and document API of MissingGraphElementPropertyException

parent 33cd728a
......@@ -23,15 +23,23 @@ package de.tudarmstadt.maki.simonstrator.api.common.graph;
/**
* This exception may be used to indicate that a necessary property of an
* {@link INode} or {@link IEdge} is not set.
*
* @author Roland Kluge - Initial Implementation
*/
public class MissingGraphElementPropertyException extends RuntimeException {
public MissingGraphElementPropertyException(IEdge edge, GraphElementProperty<?> property) {
super(String.format("Edge %s is missing required property %s", edge, property));
}
public MissingGraphElementPropertyException(INode node, GraphElementProperty<?> property) {
super(String.format("Node %s is missing required property %s", node, property));
/**
* Creates an exception to indicate that the given {@link IElement} is
* lacking the given {@link GraphElementProperty}.
*
* @param element
* the element
* @param property
* the property
*/
public MissingGraphElementPropertyException(final IElement element,
final GraphElementProperty<? extends Number> property) {
super(String.format("Element %s is missing required property %s", element.toString(), property));
}
private static final long serialVersionUID = 8622616464282511495L;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment