Package pl.poznan.put.structure.formats
Class ImmutableDefaultDotBracket
- java.lang.Object
-
- pl.poznan.put.structure.formats.DefaultDotBracket
-
- pl.poznan.put.structure.formats.ImmutableDefaultDotBracket
-
- All Implemented Interfaces:
Serializable,DotBracket
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableDefaultDotBracket extends DefaultDotBracket
Immutable implementation ofDefaultDotBracket.Use the builder to create immutable instances:
ImmutableDefaultDotBracket.builder(). Use the static factory method to create immutable instances:ImmutableDefaultDotBracket.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDefaultDotBracket.BuilderBuilds instances of typeImmutableDefaultDotBracket.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableDefaultDotBracket.Builderbuilder()Creates a builder forImmutableDefaultDotBracket.protected List<List<Strand>>candidatesToCombine()static ImmutableDefaultDotBracketcopyOf(DefaultDotBracket instance)Creates an immutable copy of aDefaultDotBracketvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableDefaultDotBracketthat have equal attribute values.inthashCode()Computes a hash code from attributes:sequence,structure.static ImmutableDefaultDotBracketof(String sequence, String structure)Construct a new immutableDefaultDotBracketinstance.Map<DotBracketSymbol,DotBracketSymbol>pairs()Stringsequence()List<Strand>strands()Stringstructure()List<DotBracketSymbol>symbols()ImmutableDefaultDotBracketwithSequence(String value)Copy the current immutable object by setting a value for thesequenceattribute.ImmutableDefaultDotBracketwithStrands(Iterable<? extends Strand> elements)Copy the current immutable object with elements that replace the content ofstrands.ImmutableDefaultDotBracketwithStrands(Strand... elements)Copy the current immutable object with elements that replace the content ofstrands.ImmutableDefaultDotBracketwithStructure(String value)Copy the current immutable object by setting a value for thestructureattribute.-
Methods inherited from class pl.poznan.put.structure.formats.DefaultDotBracket
combineStrands, copyWithStrands, fromString, toString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface pl.poznan.put.structure.formats.DotBracket
containsMissing, findStrand, length, missingInternal, missingTerminal, originalIndex, pseudoknotOrder, sequence, structure, toStringWithStrands
-
-
-
-
Method Detail
-
strands
public List<Strand> strands()
- Specified by:
strandsin interfaceDotBracket- Overrides:
strandsin classDefaultDotBracket- Returns:
- The value of the
strandsattribute
-
sequence
public String sequence()
- Specified by:
sequencein interfaceDotBracket- Specified by:
sequencein classDefaultDotBracket- Returns:
- The value of the
sequenceattribute
-
structure
public String structure()
- Specified by:
structurein interfaceDotBracket- Specified by:
structurein classDefaultDotBracket- Returns:
- The value of the
structureattribute
-
withStrands
public final ImmutableDefaultDotBracket withStrands(Strand... elements)
Copy the current immutable object with elements that replace the content ofstrands.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withStrands
public final ImmutableDefaultDotBracket withStrands(Iterable<? extends Strand> elements)
Copy the current immutable object with elements that replace the content ofstrands. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of strands elements to set- Returns:
- A modified copy of
thisobject
-
withSequence
public final ImmutableDefaultDotBracket withSequence(String value)
Copy the current immutable object by setting a value for thesequenceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sequence- Returns:
- A modified copy of the
thisobject
-
withStructure
public final ImmutableDefaultDotBracket withStructure(String value)
Copy the current immutable object by setting a value for thestructureattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for structure- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableDefaultDotBracketthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sequence,structure.
-
pairs
public Map<DotBracketSymbol,DotBracketSymbol> pairs()
Returns a lazily initialized value of the
pairsattribute. 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.- Specified by:
pairsin interfaceDotBracket- Overrides:
pairsin classDefaultDotBracket- Returns:
- A lazily initialized value of the
pairsattribute
-
of
public static ImmutableDefaultDotBracket of(String sequence, String structure)
Construct a new immutableDefaultDotBracketinstance.- Parameters:
sequence- The value for thesequenceattributestructure- The value for thestructureattribute- Returns:
- An immutable DefaultDotBracket instance
-
copyOf
public static ImmutableDefaultDotBracket copyOf(DefaultDotBracket instance)
Creates an immutable copy of aDefaultDotBracketvalue. 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 DefaultDotBracket instance
-
builder
public static ImmutableDefaultDotBracket.Builder builder()
Creates a builder forImmutableDefaultDotBracket.ImmutableDefaultDotBracket.builder() .addStrands|addAllStrands(pl.poznan.put.structure.formats.Strand) //strandselements .sequence(String) // requiredsequence.structure(String) // requiredstructure.build();- Returns:
- A new ImmutableDefaultDotBracket builder
-
symbols
public List<DotBracketSymbol> symbols()
- Specified by:
symbolsin interfaceDotBracket- Returns:
- The list of dot-bracket symbols.
-
-