Class ResourceBuilder


  • public final class ResourceBuilder
    extends java.lang.Object

    Utility class for creating a `Graph` where all the statements are about a particular resource

    Since:
    1.0
    Version:
    1.0
    Author:
    Michael Grove
    • Constructor Detail

      • ResourceBuilder

        public ResourceBuilder​(@Nonnull
                               Resource theRes)
      • ResourceBuilder

        public ResourceBuilder​(@Nonnull
                               java.util.Set<Statement> theGraph,
                               @Nonnull
                               Resource theRes)
    • Method Detail

      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nonnull
                                           java.net.URI theURI)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nonnull
                                           java.util.List<? extends Value> theList)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           Value theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.util.Set<? extends Value> theSet)
      • subject

        @Nonnull
        public Resource subject()
      • graph

        @Nonnull
        public java.util.Set<Statement> graph()
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.String theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Integer theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Long theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Short theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Double theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.util.Date theValue)
        Add a xsd:dateTime property to the resource
        Parameters:
        theProperty - the property
        theValue - the date-time object
        Returns:
        this builder
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Float theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Boolean theValue)
      • addProperty

        @Nonnull
        public ResourceBuilder addProperty​(@Nonnull
                                           IRI theProperty,
                                           @Nullable
                                           java.lang.Object theObject)
      • addLabel

        @Nonnull
        public ResourceBuilder addLabel​(@Nullable
                                        java.lang.String theLabel)