Interface Property<V>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Property.Exceptions
      Common exceptions to use with a property.
    • Method Detail

      • key

        String key()
        The key of the property.
        Returns:
        The property key
      • isPresent

        boolean isPresent()
        Whether the property is empty or not.
        Returns:
        True if the property exists, else false
      • ifPresent

        default void ifPresent​(Consumer<? super V> consumer)
        If the property is present, the consume the value as specified by the Consumer.
        Parameters:
        consumer - The consumer to process the existing value.
      • orElse

        default 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
      • orElseGet

        default V orElseGet​(Supplier<? extends V> valueSupplier)
        If the value is present, return the value, else generate a value given the Supplier.
        Parameters:
        valueSupplier - The supplier to use to generate a value if the property is not present
        Returns:
        A value
      • orElseThrow

        default <E extends ThrowableV orElseThrow​(Supplier<? extends E> exceptionSupplier)
                                             throws E extends Throwable
        If the value is present, return the value, else throw the exception generated by the Supplier.
        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
      • element

        Element element()
        Get the element that this property is associated with.
        Returns:
        The element associated with this property (i.e. Vertex, Edge, or VertexProperty).
      • remove

        void remove()
        Remove the property from the associated element.
      • empty

        static <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