/** * Adds a connection. * @param from Start of the connection. * @param to End of the connection. * @param connData The connection data wrapped in an optional. */ protected void addConnection(Point from, Point to, Optional<E> connData) { checkArgument(!from.equals(to), "A connection cannot be circular: %s -> %s ", from, to); checkArgument(!hasConnection(from, to), "Connection already exists: %s -> %s ", from, to); doAddConnection(from, to, connData); }
/** * Adds a connection. * @param from Start of the connection. * @param to End of the connection. * @param connData The connection data wrapped in an optional. */ protected void addConnection(Point from, Point to, Optional<E> connData) { checkArgument(!from.equals(to), "A connection cannot be circular: %s -> %s ", from, to); checkArgument(!hasConnection(from, to), "Connection already exists: %s -> %s ", from, to); doAddConnection(from, to, connData); }