Downstreams need logic to adjust the inference unless it is empty.
Expose an isEmpty() method, which efficiently indicates whether the
inference is empty.
Change-Id: Ief6df4d8c2e1db34ea65bb6bdbd7e47525683dad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
return ImmutableList.copyOf(deque);
}
+ /**
+ * Return {@code true} if this inference is empty. This is a more efficient alternative to
+ * {@code statementPath().isEmpty()}.
+ *
+ * @return {@code true} if {@link #statementPath()} returns an empty list
+ */
+ public boolean isEmpty() {
+ return deque.isEmpty();
+ }
+
/**
* Convert this inference into a {@link SchemaInferenceStack}.
*