java.lang.Object
com.riadalabs.jira.plugins.insight.services.model.graph.Graph
com.riadalabs.jira.plugins.insight.services.model.graph.ImmutableGraph

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableGraph extends Graph
Immutable implementation of Graph.

Use the builder to create immutable instances: ImmutableGraph.builder().

  • Method Details

    • nodes

      public Collection<Node> nodes()
      Specified by:
      nodes in class Graph
      Returns:
      The value of the nodes attribute
    • edges

      public Collection<Edge> edges()
      Specified by:
      edges in class Graph
      Returns:
      The value of the edges attribute
    • isIncomplete

      public Optional<Boolean> isIncomplete()
      Specified by:
      isIncomplete in class Graph
      Returns:
      The value of the incomplete attribute
    • withNodes

      public final ImmutableGraph withNodes(Collection<Node> value)
      Copy the current immutable object by setting a value for the nodes attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for nodes
      Returns:
      A modified copy of the this object
    • withEdges

      public final ImmutableGraph withEdges(Collection<Edge> value)
      Copy the current immutable object by setting a value for the edges attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for edges
      Returns:
      A modified copy of the this object
    • withIncomplete

      public final ImmutableGraph withIncomplete(boolean value)
      Copy the current immutable object by setting a present value for the optional incomplete attribute.
      Parameters:
      value - The value for incomplete
      Returns:
      A modified copy of this object
    • withIncomplete

      public final ImmutableGraph withIncomplete(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the incomplete attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for incomplete
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableGraph 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: nodes, edges, incomplete.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableGraph copyOf(Graph instance)
      Creates an immutable copy of a Graph 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 Graph instance
    • builder

      public static ImmutableGraph.Builder builder()
      Creates a builder for ImmutableGraph.
       ImmutableGraph.builder()
          .setNodes(Collection&lt;com.riadalabs.jira.plugins.insight.services.model.graph.Node&gt;) // required nodes
          .setEdges(Collection&lt;com.riadalabs.jira.plugins.insight.services.model.graph.Edge&gt;) // required edges
          .setIncomplete(Boolean) // optional incomplete
          .build();
       
      Returns:
      A new ImmutableGraph builder