Class ImmutableRegion
- java.lang.Object
-
- pl.poznan.put.structure.pseudoknots.Region
-
- pl.poznan.put.structure.pseudoknots.ImmutableRegion
-
- All Implemented Interfaces:
Comparable<Region>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableRegion extends Region
Immutable implementation ofRegion.Use the builder to create immutable instances:
ImmutableRegion.builder(). Use the static factory method to create immutable instances:ImmutableRegion.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableRegion.BuilderBuilds instances of typeImmutableRegion.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbegin()static ImmutableRegion.Builderbuilder()Creates a builder forImmutableRegion.static ImmutableRegioncopyOf(Region instance)Creates an immutable copy of aRegionvalue.intend()List<BpSeq.Entry>entries()booleanequals(Object another)This instance is equal to all instances ofImmutableRegionthat have equal attribute values.inthashCode()Computes a hash code from attributes:entries,begin,end.booleanisRemoved()static ImmutableRegionof(Iterable<? extends BpSeq.Entry> entries)Construct a new immutableRegioninstance.static ImmutableRegionof(List<BpSeq.Entry> entries)Construct a new immutableRegioninstance.ImmutableRegionwithBegin(int value)Copy the current immutable object by setting a value for thebeginattribute.ImmutableRegionwithEnd(int value)Copy the current immutable object by setting a value for theendattribute.ImmutableRegionwithEntries(Iterable<? extends BpSeq.Entry> elements)Copy the current immutable object with elements that replace the content ofentries.ImmutableRegionwithEntries(BpSeq.Entry... elements)Copy the current immutable object with elements that replace the content ofentries.ImmutableRegionwithIsRemoved(boolean value)Copy the current immutable object by setting a value for theisRemovedattribute.
-
-
-
Method Detail
-
entries
public List<BpSeq.Entry> entries()
-
isRemoved
public boolean isRemoved()
-
withEntries
public final ImmutableRegion withEntries(BpSeq.Entry... elements)
Copy the current immutable object with elements that replace the content ofentries.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withEntries
public final ImmutableRegion withEntries(Iterable<? extends BpSeq.Entry> elements)
Copy the current immutable object with elements that replace the content ofentries. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of entries elements to set- Returns:
- A modified copy of
thisobject
-
withBegin
public final ImmutableRegion withBegin(int value)
Copy the current immutable object by setting a value for thebeginattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for begin- Returns:
- A modified copy of the
thisobject
-
withEnd
public final ImmutableRegion withEnd(int value)
Copy the current immutable object by setting a value for theendattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for end- Returns:
- A modified copy of the
thisobject
-
withIsRemoved
public final ImmutableRegion withIsRemoved(boolean value)
Copy the current immutable object by setting a value for theisRemovedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isRemoved- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableRegionthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:entries,begin,end.
-
of
public static ImmutableRegion of(List<BpSeq.Entry> entries)
Construct a new immutableRegioninstance.- Parameters:
entries- The value for theentriesattribute- Returns:
- An immutable Region instance
-
of
public static ImmutableRegion of(Iterable<? extends BpSeq.Entry> entries)
Construct a new immutableRegioninstance.- Parameters:
entries- The value for theentriesattribute- Returns:
- An immutable Region instance
-
copyOf
public static ImmutableRegion copyOf(Region instance)
Creates an immutable copy of aRegionvalue. 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 forImmutableRegion.ImmutableRegion.builder() .addEntries|addAllEntries(pl.poznan.put.structure.formats.BpSeq.Entry) //entrieselements .begin(int) // optionalbegin.end(int) // optionalend.isRemoved(boolean) // optionalisRemoved.build();- Returns:
- A new ImmutableRegion builder
-
-