/** * 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)); }
/** * 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)); }