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 ofDotBracketSymbol.Use the builder to create immutable instances:
ImmutableDotBracketSymbol.builder(). Use the static factory method to create immutable instances:ImmutableDotBracketSymbol.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDotBracketSymbol.BuilderBuilds instances of typeImmutableDotBracketSymbol.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableDotBracketSymbol.Builderbuilder()Creates a builder forImmutableDotBracketSymbol.static ImmutableDotBracketSymbolcopyOf(DotBracketSymbol instance)Creates an immutable copy of aDotBracketSymbolvalue.booleanequals(Object another)This 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()charstructure()ImmutableDotBracketSymbolwithIndex(int value)Copy the current immutable object by setting a value for theindexattribute.ImmutableDotBracketSymbolwithSequence(char value)Copy the current immutable object by setting a value for thesequenceattribute.ImmutableDotBracketSymbolwithStructure(char value)Copy the current immutable object by setting a value for thestructureattribute.
-
-
-
Method Detail
-
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
public final ImmutableDotBracketSymbol withSequence(char value)
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
public final ImmutableDotBracketSymbol withStructure(char value)
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
public final ImmutableDotBracketSymbol withIndex(int value)
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
public boolean equals(@Nullable Object another)
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
public static ImmutableDotBracketSymbol of(char sequence, char structure, int index)
Construct a new immutableDotBracketSymbolinstance.- Parameters:
sequence- The value for thesequenceattributestructure- The value for thestructureattributeindex- The value for theindexattribute- Returns:
- An immutable DotBracketSymbol instance
-
copyOf
public static ImmutableDotBracketSymbol copyOf(DotBracketSymbol instance)
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
public static ImmutableDotBracketSymbol.Builder builder()
Creates a builder forImmutableDotBracketSymbol.ImmutableDotBracketSymbol.builder() .sequence(char) // requiredsequence.structure(char) // requiredstructure.index(int) // requiredindex.build();- Returns:
- A new ImmutableDotBracketSymbol builder
-
-