Class Edge.Builder

  • Enclosing class:
    Edge

    @NotThreadSafe
    public static final class Edge.Builder
    extends Object
    Builds instances of type Edge. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for Edge instances.
         new Edge.Builder()
            .meta(org.geneontology.obographs.core.model.Meta | null) // nullable meta
            .sub(String) // required sub
            .pred(String) // required pred
            .obj(String) // required obj
            .build();
         
    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final Edge.Builder from​(NodeOrEdge instance)
        Fill a builder with attribute values from the provided org.geneontology.obographs.core.model.NodeOrEdge instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        @CanIgnoreReturnValue
        public final Edge.Builder from​(AbstractEdge instance)
        Fill a builder with attribute values from the provided org.geneontology.obographs.core.model.AbstractEdge instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • meta

        @CanIgnoreReturnValue
        public final Edge.Builder meta​(@Nullable
                                       Meta meta)
        Initializes the value for the meta attribute.
        Parameters:
        meta - The value for meta (can be null)
        Returns:
        this builder for use in a chained invocation
      • sub

        @CanIgnoreReturnValue
        public final Edge.Builder sub​(String sub)
        Initializes the value for the sub attribute.
        Parameters:
        sub - The value for sub
        Returns:
        this builder for use in a chained invocation
      • pred

        @CanIgnoreReturnValue
        public final Edge.Builder pred​(String pred)
        Initializes the value for the pred attribute.
        Parameters:
        pred - The value for pred
        Returns:
        this builder for use in a chained invocation
      • obj

        @CanIgnoreReturnValue
        public final Edge.Builder obj​(String obj)
        Initializes the value for the obj attribute.
        Parameters:
        obj - The value for obj
        Returns:
        this builder for use in a chained invocation
      • build

        public Edge build()
        Builds a new Edge.
        Returns:
        An immutable instance of Edge
        Throws:
        IllegalStateException - if any required attributes are missing