Class ImmutableRegion

  • All Implemented Interfaces:
    Comparable<Region>

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableRegion
    extends Region
    Immutable implementation of Region.

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

    • Method Detail

      • begin

        public int begin()
        Overrides:
        begin in class Region
        Returns:
        The first index of a region.
      • end

        public int end()
        Overrides:
        end in class Region
        Returns:
        The last index of a region.
      • isRemoved

        public boolean isRemoved()
        Overrides:
        isRemoved in class Region
        Returns:
        True if this region was removed.
      • withEntries

        public final ImmutableRegion withEntries​(BpSeq.Entry... elements)
        Copy the current immutable object with elements that replace the content of entries.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withEntries

        public final ImmutableRegion withEntries​(Iterable<? extends BpSeq.Entry> elements)
        Copy the current immutable object with elements that replace the content of entries. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of entries elements to set
        Returns:
        A modified copy of this object
      • withBegin

        public final ImmutableRegion withBegin​(int value)
        Copy the current immutable object by setting a value for the begin attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for begin
        Returns:
        A modified copy of the this object
      • withEnd

        public final ImmutableRegion withEnd​(int value)
        Copy the current immutable object by setting a value for the end attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for end
        Returns:
        A modified copy of the this object
      • withIsRemoved

        public final ImmutableRegion withIsRemoved​(boolean value)
        Copy the current immutable object by setting a value for the isRemoved attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for isRemoved
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableRegion 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: entries, begin, end.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • of

        public static ImmutableRegion of​(List<BpSeq.Entry> entries)
        Construct a new immutable Region instance.
        Parameters:
        entries - The value for the entries attribute
        Returns:
        An immutable Region instance
      • of

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

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

        public static ImmutableRegion.Builder builder()
        Creates a builder for ImmutableRegion.
         ImmutableRegion.builder()
            .addEntries|addAllEntries(pl.poznan.put.structure.formats.BpSeq.Entry) // entries elements
            .begin(int) // optional begin
            .end(int) // optional end
            .isRemoved(boolean) // optional isRemoved
            .build();
         
        Returns:
        A new ImmutableRegion builder