@Override public V value() throws NoSuchElementException { throw Exceptions.propertyDoesNotExist(); }
@Override public Object id() { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public Graph graph() { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public Graph graph() { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public Element element() { throw Exceptions.propertyDoesNotExist(); }
@Override public V value() throws NoSuchElementException { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public Vertex element() { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public String key() { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public Element element() { throw Exceptions.propertyDoesNotExist(); }
@Override public V value() throws NoSuchElementException { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public Vertex element() { throw Property.Exceptions.propertyDoesNotExist(); }
@Override public V value() throws NoSuchElementException { throw Exceptions.propertyDoesNotExist(); }
/** * Get the value of a {@link Property} given it's key. * The default implementation calls {@link Element#property} and then returns the associated value. * * @throws NoSuchElementException if the property does not exist on the {@code Element}. */ public default <V> V value(final String key) throws NoSuchElementException { return this.<V>property(key).orElseThrow(() -> Property.Exceptions.propertyDoesNotExist(this,key)); }
@Test @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES) @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = FEATURE_PROPERTIES) public void shouldGetValueThatIsNotPresentOnVertex() { final Vertex v = graph.addVertex(); try { v.value("doesnotexist"); fail("Call to Element.value() with a key that is not present should throw an exception"); } catch (Exception ex) { validateException(Property.Exceptions.propertyDoesNotExist(v, "doesnotexist"), ex); } }
@Override public <A> A value(String key) { throw Property.Exceptions.propertyDoesNotExist(this,key); }
@Override public <O> O value(String key) { if (!tx().containsPropertyKey(key)) throw Property.Exceptions.propertyDoesNotExist(this,key); O val = valueOrNull(tx().getPropertyKey(key)); if (val==null) throw Property.Exceptions.propertyDoesNotExist(this,key); return val; }
@Override public <O> O value(String key) { verifyAccess(); O val = valueInternal(tx().getPropertyKey(key)); if (val == null) { throw Property.Exceptions.propertyDoesNotExist(this, key); } return val; }
@Override public <V> V value(String key) { throw Property.Exceptions.propertyDoesNotExist(this,key); }
@Override public <O> O value(String key) { if (!tx().containsPropertyKey(key)) throw Property.Exceptions.propertyDoesNotExist(this,key); O val = valueOrNull(tx().getPropertyKey(key)); if (val==null) throw Property.Exceptions.propertyDoesNotExist(this,key); return val; }
@Override public <O> O value(String key) { verifyAccess(); O val = valueInternal(tx().getPropertyKey(key)); if (val==null) throw Property.Exceptions.propertyDoesNotExist(this,key); return val; }