public static Optional<String> getLabelValue(final Object... keyValues) {
        for (int i = 0; i < keyValues.length; i = i + 2) {
            if (keyValues[i].equals(T.label)) {
                ElementHelper.validateLabel((String) keyValues[i + 1]);
                return Optional.of((String) keyValues[i + 1]);
            }
        }
        return Optional.empty();
    }
Extracts the value of the {@link T#label} key from the list of arguments.

@param keyValues a list of key/value pairs
@return the value associated with {@link T#label}
@throws ClassCastException   if the value of the label is not a {@link String}
@throws NullPointerException if the value for the {@link T#label} key is {@code null}
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java