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 class
Builds instances of typeImmutableDotBracketSymbol
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableDotBracketSymbol
.static ImmutableDotBracketSymbol
copyOf
(DotBracketSymbol instance) Creates an immutable copy of aDotBracketSymbol
value.boolean
This instance is equal to all instances ofImmutableDotBracketSymbol
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sequence
,structure
,index
.int
index()
static ImmutableDotBracketSymbol
of
(char sequence, char structure, int index) Construct a new immutableDotBracketSymbol
instance.char
sequence()
char
withIndex
(int value) Copy the current immutable object by setting a value for theindex
attribute.withSequence
(char value) Copy the current immutable object by setting a value for thesequence
attribute.withStructure
(char value) Copy the current immutable object by setting a value for thestructure
attribute.
-
Method Details
-
sequence
public char sequence()- Specified by:
sequence
in classDotBracketSymbol
- Returns:
- The sequence character.
-
structure
public char structure()- Specified by:
structure
in classDotBracketSymbol
- Returns:
- The structure character (dot or bracket).
-
index
public int index()- Specified by:
index
in classDotBracketSymbol
- Returns:
- The index of this symbol.
-
withSequence
Copy the current immutable object by setting a value for thesequence
attribute. 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
this
object
-
withStructure
Copy the current immutable object by setting a value for thestructure
attribute. 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
this
object
-
withIndex
Copy the current immutable object by setting a value for theindex
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutableDotBracketSymbol
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sequence
,structure
,index
. -
of
Construct a new immutableDotBracketSymbol
instance.- Parameters:
sequence
- The value for thesequence
attributestructure
- The value for thestructure
attributeindex
- The value for theindex
attribute- Returns:
- An immutable DotBracketSymbol instance
-
copyOf
Creates an immutable copy of aDotBracketSymbol
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 DotBracketSymbol instance
-
builder
Creates a builder forImmutableDotBracketSymbol
.ImmutableDotBracketSymbol.builder() .sequence(char) // required
sequence
.structure(char) // requiredstructure
.index(int) // requiredindex
.build();- Returns:
- A new ImmutableDotBracketSymbol builder
-