public class StrategyProperty<V> extends java.lang.Object implements Property<V>, StrategyWrapped, WrappedProperty<Property<V>>
Property.Exceptions| Constructor and Description |
|---|
StrategyProperty(Property<V> baseProperty,
StrategyGraph strategyGraph) |
| Modifier and Type | Method and Description |
|---|---|
Element |
element()
Get the element that this property is associated with.
|
Property<V> |
getBaseProperty() |
void |
ifPresent(java.util.function.Consumer<? super V> consumer)
If the property is present, the consume the value as specified by the
Consumer. |
boolean |
isPresent()
Whether the property is empty or not.
|
java.lang.String |
key()
The key of the property.
|
V |
orElse(V otherValue)
If the value is present, return the value, else return the provided value.
|
V |
orElseGet(java.util.function.Supplier<? extends V> valueSupplier)
If the value is present, return the value, else generate a value given the
Supplier. |
<E extends java.lang.Throwable> |
orElseThrow(java.util.function.Supplier<? extends E> exceptionSupplier)
If the value is present, return the value, else throw the exception generated by the
Supplier. |
void |
remove()
Remove the property from the associated element.
|
java.lang.String |
toString() |
V |
value()
The value of the property.
|
public StrategyProperty(Property<V> baseProperty, StrategyGraph strategyGraph)
public java.lang.String key()
Propertypublic V value() throws java.util.NoSuchElementException
Propertypublic boolean isPresent()
Propertypublic Element element()
Propertypublic <E extends java.lang.Throwable> V orElseThrow(java.util.function.Supplier<? extends E> exceptionSupplier) throws E extends java.lang.Throwable
PropertySupplier.orElseThrow in interface Property<V>E - The exception typeexceptionSupplier - The supplier to generate an exception if the property is not presentE - if the property is not present, the exception is thrownE extends java.lang.Throwablepublic V orElseGet(java.util.function.Supplier<? extends V> valueSupplier)
PropertySupplier.public V orElse(V otherValue)
Propertypublic void ifPresent(java.util.function.Consumer<? super V> consumer)
PropertyConsumer.public void remove()
Propertypublic java.lang.String toString()
toString in class java.lang.Objectpublic Property<V> getBaseProperty()
getBaseProperty in interface WrappedProperty<Property<V>>Copyright © 2013-2015 TinkerPop. All Rights Reserved.