Interface AttributeValue


  • public interface AttributeValue
    Selector attribute values are the data model of selectors.
    • Method Detail

      • toString

        java.lang.String toString()
        Returns the string version of an attribute value.
        Overrides:
        toString in class java.lang.Object
        Returns:
        Returns the string representation or an empty string.
      • toMessageString

        default java.lang.String toMessageString()
        Returns a string representation of the value that can be used for creating formatted messages.

        This implementation gets the value of toString() by default.

        Returns:
        Returns the message string.
      • getProperty

        AttributeValue getProperty​(java.lang.String key)
        Gets a property from the attribute value.

        This method never returns null. It should instead return a null value object when the property does not exist.

        Parameters:
        key - Property to get.
        Returns:
        Returns the nested property.
      • getPath

        default AttributeValue getPath​(java.util.List<java.lang.String> path)
        Gets a property using a path to the property.
        Parameters:
        path - The path to select from the value.
        Returns:
        Returns the created attribute value.
      • isPresent

        default boolean isPresent()
        Checks if the attribute value is considered present.

        Attribute value are considered present if they are not null. If the attribute value is a projection, then it is considered present if it is not empty.

        Returns:
        Returns true if present.
      • getFlattenedValues

        default java.util.Collection<? extends AttributeValue> getFlattenedValues()
        Gets all of the attribute values contained in the attribute value.

        This will yield a single result for normal attributes, or a list of multiple values for projections.

        Returns:
        Returns the flattened attribute values contained in the attribute value.
      • shape

        static AttributeValue shape​(Shape shape,
                                    java.util.Map<java.lang.String,​java.util.Set<Shape>> vars)
        Creates a 'shape' AttributeValue for the given shape.
        Parameters:
        shape - Shape to path into.
        vars - Variables accessible to the shape.
        Returns:
        Returns the created selector value.
      • id

        static AttributeValue id​(ShapeId id)
        Creates an 'id' AttributeValue from a shape ID.
        Parameters:
        id - Shape ID to create.
        Returns:
        Returns the created selector value.
      • service

        static AttributeValue service​(ServiceShape service)
        Creates a 'service' AttributeValue from a service shape.
        Parameters:
        service - Shape to create.
        Returns:
        Returns the created selector value.
      • emptyValue

        static AttributeValue emptyValue()
        Creates an empty AttributeValue object.
        Returns:
        Returns the created selector value.
      • literal

        static AttributeValue literal​(java.lang.Object literal)
        Creates an AttributeValue that contains a literal value.
        Parameters:
        literal - Literal value to wrap.
        Returns:
        Returns the created selector value.
      • node

        static AttributeValue node​(Node node)
        Creates a 'node' AttributeValue for a Node.
        Parameters:
        node - Node to create the value from.
        Returns:
        Returns the created attribute value.
      • projection

        static AttributeValue projection​(java.util.Collection<AttributeValue> values)
        Creates a 'projection' AttributeValue.
        Parameters:
        values - Values stored in the projection.
        Returns:
        Returns the created projection.