Class MetadataSet.Builder

  • Enclosing class:
    MetadataSet

    public static final class MetadataSet.Builder
    extends java.lang.Object
    A builder for sets of metadata expressions.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • build

        public MetadataSet build()
        Builds the set. Must be called after all metadata expressions have been added.
        Returns:
        an immutable metadata set
        Throws:
        java.lang.IllegalStateException - if a cycle is found in the graph of refining expressions
      • meta

        public MetadataSet.Builder meta​(java.lang.String id,
                                        Property property,
                                        java.lang.String value,
                                        java.lang.String refines)
        Adds a metadata expression to the set being built.
        Parameters:
        id - the ID of the element holding the expression, can be null.
        property - the property representing the statement of the expression (must not be null)
        value - the value representing the assertion of the expression (can, but should not, be null)
        refines - the ID of the expression or resource refined by this expression. If the given string starts with the character '#' (relative fragment URI), it is stripped to get the ID. Can be null
        Returns:
        this builder