Class GraphDocument

java.lang.Object
org.geneontology.obographs.core.model.AbstractGraphDocument
org.geneontology.obographs.core.model.GraphDocument

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class GraphDocument extends AbstractGraphDocument
Holds a collection of graphs, plus document-level metadata ## Model ![Node UML](graphdocument.png)
Author:
cjm
  • Method Details

    • getContext

      @Nullable public Object getContext()
      The JSON-LD context for this document. This needs to be an unstructured Object, since it could be either a list or a map. We don't want to store it here as a Context because we want to roundtrip it the way it is written in the document.
      Specified by:
      getContext in class AbstractGraphDocument
    • getMeta

      @Nullable public Meta getMeta()
      Specified by:
      getMeta in class AbstractGraphDocument
      Returns:
      the meta
    • getGraphs

      public List<Graph> getGraphs()
      Specified by:
      getGraphs in class AbstractGraphDocument
      Returns:
      the graphs
    • withContext

      public final GraphDocument withContext(@Nullable Object value)
      Copy the current immutable object by setting a value for the context attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for context (can be null)
      Returns:
      A modified copy of the this object
    • withMeta

      public final GraphDocument withMeta(@Nullable Meta value)
      Copy the current immutable object by setting a value for the meta attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for meta (can be null)
      Returns:
      A modified copy of the this object
    • withGraphs

      public final GraphDocument withGraphs(Graph... elements)
      Copy the current immutable object with elements that replace the content of graphs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withGraphs

      public final GraphDocument withGraphs(Iterable<? extends Graph> elements)
      Copy the current immutable object with elements that replace the content of graphs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of graphs elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of GraphDocument that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: context, meta, graphs.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value GraphDocument with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static GraphDocument copyOf(AbstractGraphDocument instance)
      Creates an immutable copy of a AbstractGraphDocument value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable GraphDocument instance