Class ImmutablePdbCompactFragment

java.lang.Object
pl.poznan.put.pdb.analysis.PdbCompactFragment
pl.poznan.put.pdb.analysis.ImmutablePdbCompactFragment
All Implemented Interfaces:
Serializable, ResidueCollection, SingleTypedResidueCollection

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutablePdbCompactFragment extends PdbCompactFragment
Immutable implementation of PdbCompactFragment.

Use the builder to create immutable instances: ImmutablePdbCompactFragment.builder(). Use the static factory method to create immutable instances: ImmutablePdbCompactFragment.of().

See Also:
  • Method Details

    • residues

      public List<PdbResidue> residues()
      Specified by:
      residues in interface ResidueCollection
      Specified by:
      residues in class PdbCompactFragment
      Returns:
      The value of the residues attribute
    • name

      public String name()
      Overrides:
      name in class PdbCompactFragment
      Returns:
      The name of this compact fragment.
    • withResidues

      public final ImmutablePdbCompactFragment withResidues(PdbResidue... elements)
      Copy the current immutable object with elements that replace the content of residues.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withResidues

      public final ImmutablePdbCompactFragment withResidues(Iterable<? extends PdbResidue> elements)
      Copy the current immutable object with elements that replace the content of residues. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of residues elements to set
      Returns:
      A modified copy of this object
    • withName

      public final ImmutablePdbCompactFragment withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutablePdbCompactFragment that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: residues, name.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • angleTypes

      protected Set<TorsionAngleType> angleTypes()

      Returns a lazily initialized value of the angleTypes attribute. 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.

      Overrides:
      angleTypes in class PdbCompactFragment
      Returns:
      A lazily initialized value of the angleTypes attribute
    • angleValues

      protected List<ResidueTorsionAngles> angleValues()

      Returns a lazily initialized value of the angleValues attribute. 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.

      Overrides:
      angleValues in class PdbCompactFragment
      Returns:
      A lazily initialized value of the angleValues attribute
    • of

      public static ImmutablePdbCompactFragment of(List<PdbResidue> residues)
      Construct a new immutable PdbCompactFragment instance.
      Parameters:
      residues - The value for the residues attribute
      Returns:
      An immutable PdbCompactFragment instance
    • of

      public static ImmutablePdbCompactFragment of(Iterable<? extends PdbResidue> residues)
      Construct a new immutable PdbCompactFragment instance.
      Parameters:
      residues - The value for the residues attribute
      Returns:
      An immutable PdbCompactFragment instance
    • copyOf

      public static ImmutablePdbCompactFragment copyOf(PdbCompactFragment instance)
      Creates an immutable copy of a PdbCompactFragment 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 PdbCompactFragment instance
    • builder

      public static ImmutablePdbCompactFragment.Builder builder()
      Creates a builder for ImmutablePdbCompactFragment.
       ImmutablePdbCompactFragment.builder()
          .addResidues|addAllResidues(pl.poznan.put.pdb.analysis.PdbResidue) // residues elements
          .name(String) // optional name
          .build();
       
      Returns:
      A new ImmutablePdbCompactFragment builder