Package pl.poznan.put.rna
Class ImmutableInteractionType
- java.lang.Object
-
- pl.poznan.put.rna.InteractionType
-
- pl.poznan.put.rna.ImmutableInteractionType
-
- All Implemented Interfaces:
Serializable,Comparable<InteractionType>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableInteractionType extends InteractionType
Immutable implementation ofInteractionType.Use the builder to create immutable instances:
ImmutableInteractionType.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableInteractionType.BuilderBuilds instances of typeImmutableInteractionType.
-
Field Summary
-
Fields inherited from class pl.poznan.put.rna.InteractionType
BASE_BASE, BASE_BASE_1H, BASE_PHOSPHATE, BASE_RIBOSE, OTHER, STACKING, SUGAR_SUGAR
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableInteractionType.Builderbuilder()Creates a builder forImmutableInteractionType.static ImmutableInteractionTypecopyOf(InteractionType instance)Creates an immutable copy of aInteractionTypevalue.Stringdescription()booleanequals(Object another)This instance is equal to all instances ofImmutableInteractionTypethat have equal attribute values.inthashCode()Computes a hash code from attributes:left,right,isPairing,description.booleanisPairing()Checks if this interaction is a basis for base pairing.NucleotideComponentTypeleft()NucleotideComponentTyperight()ImmutableInteractionTypewithDescription(String value)Copy the current immutable object by setting a value for thedescriptionattribute.ImmutableInteractionTypewithIsPairing(boolean value)Copy the current immutable object by setting a value for theisPairingattribute.ImmutableInteractionTypewithLeft(NucleotideComponentType value)Copy the current immutable object by setting a value for theleftattribute.ImmutableInteractionTypewithRight(NucleotideComponentType value)Copy the current immutable object by setting a value for therightattribute.-
Methods inherited from class pl.poznan.put.rna.InteractionType
compareTo, invert, toString
-
-
-
-
Method Detail
-
left
public NucleotideComponentType left()
- Specified by:
leftin classInteractionType- Returns:
- The first interacting partner.
-
right
public NucleotideComponentType right()
- Specified by:
rightin classInteractionType- Returns:
- The second interacting partner.
-
isPairing
public boolean isPairing()
Checks if this interaction is a basis for base pairing.- Specified by:
isPairingin classInteractionType- Returns:
- True for
BASE_BASE, false for all other types.
-
description
public String description()
- Overrides:
descriptionin classInteractionType- Returns:
- The description of this interaction type.
-
withLeft
public final ImmutableInteractionType withLeft(NucleotideComponentType value)
Copy the current immutable object by setting a value for theleftattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for left- Returns:
- A modified copy of the
thisobject
-
withRight
public final ImmutableInteractionType withRight(NucleotideComponentType value)
Copy the current immutable object by setting a value for therightattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for right- Returns:
- A modified copy of the
thisobject
-
withIsPairing
public final ImmutableInteractionType withIsPairing(boolean value)
Copy the current immutable object by setting a value for theisPairingattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isPairing- Returns:
- A modified copy of the
thisobject
-
withDescription
public final ImmutableInteractionType withDescription(String value)
Copy the current immutable object by setting a value for thedescriptionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for description- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableInteractionTypethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:left,right,isPairing,description.
-
copyOf
public static ImmutableInteractionType copyOf(InteractionType instance)
Creates an immutable copy of aInteractionTypevalue. 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 InteractionType instance
-
builder
public static ImmutableInteractionType.Builder builder()
Creates a builder forImmutableInteractionType.ImmutableInteractionType.builder() .left(pl.poznan.put.rna.NucleotideComponentType) // requiredleft.right(pl.poznan.put.rna.NucleotideComponentType) // requiredright.isPairing(boolean) // requiredisPairing.description(String) // optionaldescription.build();- Returns:
- A new ImmutableInteractionType builder
-
-