Interface Property<V>
- 
- All Known Subinterfaces:
- VertexProperty<V>
 - All Known Implementing Classes:
- ComputerGraph.ComputerProperty,- ComputerGraph.ComputerVertexProperty,- DetachedProperty,- DetachedVertexProperty,- EmptyProperty,- EmptyVertexProperty,- KeyedProperty,- KeyedVertexProperty,- ReferenceProperty,- ReferenceVertexProperty,- StarGraph.StarProperty,- StarGraph.StarVertexProperty,- TinkerProperty,- TinkerVertexProperty
 
 public interface Property<V>APropertydenotes a key/value pair associated with anEdge. A property is much like a Java8Optionalin that a property can be not present (i.e. empty). The key of a property is always a String and the value of a property is an arbitrary Java object. Each underlying graph engine will typically have constraints on what Java objects are allowed to be used as values.- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classProperty.ExceptionsCommon exceptions to use with a property.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Elementelement()Get the element that this property is associated with.static <V> Property<V>empty()Create an empty property that is not present.default voidifPresent(Consumer<? super V> consumer)If the property is present, the consume the value as specified by theConsumer.booleanisPresent()Whether the property is empty or not.Stringkey()The key of the property.default VorElse(V otherValue)If the value is present, return the value, else return the provided value.default VorElseGet(Supplier<? extends V> valueSupplier)If the value is present, return the value, else generate a value given theSupplier.default <E extends Throwable>
 VorElseThrow(Supplier<? extends E> exceptionSupplier)If the value is present, return the value, else throw the exception generated by theSupplier.voidremove()Remove the property from the associated element.Vvalue()The value of the property.
 
- 
- 
- 
Method Detail- 
keyString key() The key of the property.- Returns:
- The property key
 
 - 
valueV value() throws NoSuchElementException The value of the property.- Returns:
- The property value
- Throws:
- NoSuchElementException- thrown if the property is empty
 
 - 
isPresentboolean isPresent() Whether the property is empty or not.- Returns:
- True if the property exists, else false
 
 - 
ifPresentdefault void ifPresent(Consumer<? super V> consumer) If the property is present, the consume the value as specified by theConsumer.- Parameters:
- consumer- The consumer to process the existing value.
 
 - 
orElsedefault V orElse(V otherValue) If the value is present, return the value, else return the provided value.- Parameters:
- otherValue- The value to return if the property is not present
- Returns:
- A value
 
 - 
orElseGetdefault V orElseGet(Supplier<? extends V> valueSupplier) If the value is present, return the value, else generate a value given theSupplier.- Parameters:
- valueSupplier- The supplier to use to generate a value if the property is not present
- Returns:
- A value
 
 - 
orElseThrowdefault <E extends Throwable> V orElseThrow(Supplier<? extends E> exceptionSupplier) throws E extends Throwable If the value is present, return the value, else throw the exception generated by theSupplier.- Type Parameters:
- E- The exception type
- Parameters:
- exceptionSupplier- The supplier to generate an exception if the property is not present
- Returns:
- A value
- Throws:
- E- if the property is not present, the exception is thrown
- E extends Throwable
 
 - 
elementElement element() Get the element that this property is associated with.- Returns:
- The element associated with this property (i.e. Vertex,Edge, orVertexProperty).
 
 - 
removevoid remove() Remove the property from the associated element.
 - 
emptystatic <V> Property<V> empty() Create an empty property that is not present.- Type Parameters:
- V- The value class of the empty property
- Returns:
- A property that is not present
 
 
- 
 
-