Class ImmutableConflictGraph


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableConflictGraph
    extends ConflictGraph
    Immutable implementation of ConflictGraph.

    Use the builder to create immutable instances: ImmutableConflictGraph.builder(). Use the static factory method to create immutable instances: ImmutableConflictGraph.of().

    • Method Detail

      • withRegions

        public final ImmutableConflictGraph withRegions​(Region... elements)
        Copy the current immutable object with elements that replace the content of regions.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withRegions

        public final ImmutableConflictGraph withRegions​(Iterable<? extends Region> elements)
        Copy the current immutable object with elements that replace the content of regions. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of regions 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 ImmutableConflictGraph 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: regions.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        protected Map<Region,​Set<Region>> conflicts()

        Returns a lazily initialized value of the conflicts attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

        Overrides:
        conflicts in class ConflictGraph
        Returns:
        A lazily initialized value of the conflicts attribute
      • of

        public static ImmutableConflictGraph of​(List<Region> regions)
        Construct a new immutable ConflictGraph instance.
        Parameters:
        regions - The value for the regions attribute
        Returns:
        An immutable ConflictGraph instance
      • of

        public static ImmutableConflictGraph of​(Iterable<? extends Region> regions)
        Construct a new immutable ConflictGraph instance.
        Parameters:
        regions - The value for the regions attribute
        Returns:
        An immutable ConflictGraph instance
      • copyOf

        public static ImmutableConflictGraph copyOf​(ConflictGraph instance)
        Creates an immutable copy of a ConflictGraph 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 ConflictGraph instance