Package pl.poznan.put.structure
Class ImmutableDotBracketSymbol
java.lang.Object
pl.poznan.put.structure.DotBracketSymbol
pl.poznan.put.structure.ImmutableDotBracketSymbol
- All Implemented Interfaces:
Serializable,Comparable<DotBracketSymbol>
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableDotBracketSymbol
extends DotBracketSymbol
Immutable implementation of
DotBracketSymbol.
Use the builder to create immutable instances:
ImmutableDotBracketSymbol.builder().
Use the static factory method to create immutable instances:
ImmutableDotBracketSymbol.of().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableDotBracketSymbol. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableDotBracketSymbol.static ImmutableDotBracketSymbolcopyOf(DotBracketSymbol instance) Creates an immutable copy of aDotBracketSymbolvalue.booleanThis instance is equal to all instances ofImmutableDotBracketSymbolthat have equal attribute values.inthashCode()Computes a hash code from attributes:sequence,structure,index.intindex()static ImmutableDotBracketSymbolof(char sequence, char structure, int index) Construct a new immutableDotBracketSymbolinstance.charsequence()charwithIndex(int value) Copy the current immutable object by setting a value for theindexattribute.withSequence(char value) Copy the current immutable object by setting a value for thesequenceattribute.withStructure(char value) Copy the current immutable object by setting a value for thestructureattribute.
-
Method Details
-
sequence
public char sequence()- Specified by:
sequencein classDotBracketSymbol- Returns:
- The sequence character.
-
structure
public char structure()- Specified by:
structurein classDotBracketSymbol- Returns:
- The structure character (dot or bracket).
-
index
public int index()- Specified by:
indexin classDotBracketSymbol- Returns:
- The index of this symbol.
-
withSequence
Copy the current immutable object by setting a value for thesequenceattribute. A value equality check is 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
Copy the current immutable object by setting a value for thestructureattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for structure- Returns:
- A modified copy of the
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableDotBracketSymbolthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sequence,structure,index. -
of
Construct a new immutableDotBracketSymbolinstance.- Parameters:
sequence- The value for thesequenceattributestructure- The value for thestructureattributeindex- The value for theindexattribute- Returns:
- An immutable DotBracketSymbol instance
-
copyOf
Creates an immutable copy of aDotBracketSymbolvalue. 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 DotBracketSymbol instance
-
builder
Creates a builder forImmutableDotBracketSymbol.ImmutableDotBracketSymbol.builder() .sequence(char) // requiredsequence.structure(char) // requiredstructure.index(int) // requiredindex.build();- Returns:
- A new ImmutableDotBracketSymbol builder
-