Class GraphDocument
- java.lang.Object
-
- org.geneontology.obographs.core.model.AbstractGraphDocument
-
- org.geneontology.obographs.core.model.GraphDocument
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class GraphDocument extends AbstractGraphDocument
Holds a collection of graphs, plus document-level metadata ## Model - Author:
- cjm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGraphDocument.BuilderBuilds instances of typeGraphDocument.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GraphDocumentcopyOf(AbstractGraphDocument instance)Creates an immutable copy of aAbstractGraphDocumentvalue.booleanequals(Object another)This instance is equal to all instances ofGraphDocumentthat have equal attribute values.ObjectgetContext()The JSON-LD context for this document.com.google.common.collect.ImmutableList<Graph>getGraphs()MetagetMeta()inthashCode()Computes a hash code from attributes:context,meta,graphs.StringtoString()Prints the immutable valueGraphDocumentwith attribute values.GraphDocumentwithContext(Object value)Copy the current immutable object by setting a value for thecontextattribute.GraphDocumentwithGraphs(Iterable<? extends Graph> elements)Copy the current immutable object with elements that replace the content ofgraphs.GraphDocumentwithGraphs(Graph... elements)Copy the current immutable object with elements that replace the content ofgraphs.GraphDocumentwithMeta(Meta value)Copy the current immutable object by setting a value for themetaattribute.
-
-
-
Method Detail
-
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:
getContextin classAbstractGraphDocument
-
getMeta
@Nullable public Meta getMeta()
- Specified by:
getMetain classAbstractGraphDocument- Returns:
- the meta
-
getGraphs
public com.google.common.collect.ImmutableList<Graph> getGraphs()
- Specified by:
getGraphsin classAbstractGraphDocument- Returns:
- the graphs
-
withContext
public final GraphDocument withContext(@Nullable Object value)
Copy the current immutable object by setting a value for thecontextattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for context (can benull)- Returns:
- A modified copy of the
thisobject
-
withMeta
public final GraphDocument withMeta(@Nullable Meta value)
Copy the current immutable object by setting a value for themetaattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for meta (can benull)- Returns:
- A modified copy of the
thisobject
-
withGraphs
public final GraphDocument withGraphs(Graph... elements)
Copy the current immutable object with elements that replace the content ofgraphs.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withGraphs
public final GraphDocument withGraphs(Iterable<? extends Graph> elements)
Copy the current immutable object with elements that replace the content ofgraphs. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of graphs elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofGraphDocumentthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:context,meta,graphs.
-
toString
public String toString()
Prints the immutable valueGraphDocumentwith attribute values.
-
copyOf
public static GraphDocument copyOf(AbstractGraphDocument instance)
Creates an immutable copy of aAbstractGraphDocumentvalue. 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
-
-