Class ImmutableDefaultPdbResidue

java.lang.Object
pl.poznan.put.pdb.analysis.DefaultPdbResidue
pl.poznan.put.pdb.analysis.ImmutableDefaultPdbResidue
All Implemented Interfaces:
Serializable, Comparable<ChainNumberICode>, PdbResidue, ChainNumberICode

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

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

See Also:
  • Method Details

    • identifier

      public PdbResidueIdentifier identifier()
      Specified by:
      identifier in interface PdbResidue
      Specified by:
      identifier in class DefaultPdbResidue
      Returns:
      The value of the identifier attribute
    • standardResidueName

      public String standardResidueName()
      Specified by:
      standardResidueName in interface PdbResidue
      Specified by:
      standardResidueName in class DefaultPdbResidue
      Returns:
      The value of the standardResidueName attribute
    • modifiedResidueName

      public String modifiedResidueName()
      Specified by:
      modifiedResidueName in interface PdbResidue
      Specified by:
      modifiedResidueName in class DefaultPdbResidue
      Returns:
      The value of the modifiedResidueName attribute
    • atoms

      public List<PdbAtomLine> atoms()
      Specified by:
      atoms in interface PdbResidue
      Specified by:
      atoms in class DefaultPdbResidue
      Returns:
      The value of the atoms attribute
    • withIdentifier

      public final ImmutableDefaultPdbResidue withIdentifier(PdbResidueIdentifier value)
      Copy the current immutable object by setting a value for the identifier attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for identifier
      Returns:
      A modified copy of the this object
    • withStandardResidueName

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

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

      public final ImmutableDefaultPdbResidue withAtoms(PdbAtomLine... elements)
      Copy the current immutable object with elements that replace the content of atoms.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAtoms

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDefaultPdbResidue 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: identifier, standardResidueName, modifiedResidueName, atoms.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • residueInformationProvider

      public ResidueInformationProvider residueInformationProvider()
      Detects the type of residue by its name and atom content.

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

      Specified by:
      residueInformationProvider in interface PdbResidue
      Overrides:
      residueInformationProvider in class DefaultPdbResidue
      Returns:
      A lazily initialized value of the residueInformationProvider attribute
    • atomNames

      public Set<AtomName> atomNames()

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

      Specified by:
      atomNames in interface PdbResidue
      Overrides:
      atomNames in class DefaultPdbResidue
      Returns:
      A lazily initialized value of the atomNames attribute
    • hasAllHeavyAtoms

      public boolean hasAllHeavyAtoms()
      Compares the set of actual atoms in this residue with the set of expected atoms derived from the detected type of residue.

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

      Specified by:
      hasAllHeavyAtoms in interface PdbResidue
      Overrides:
      hasAllHeavyAtoms in class DefaultPdbResidue
      Returns:
      A lazily initialized value of the hasAllHeavyAtoms attribute
    • of

      public static ImmutableDefaultPdbResidue of(PdbResidueIdentifier identifier, String standardResidueName, String modifiedResidueName, List<PdbAtomLine> atoms)
      Construct a new immutable DefaultPdbResidue instance.
      Parameters:
      identifier - The value for the identifier attribute
      standardResidueName - The value for the standardResidueName attribute
      modifiedResidueName - The value for the modifiedResidueName attribute
      atoms - The value for the atoms attribute
      Returns:
      An immutable DefaultPdbResidue instance
    • of

      public static ImmutableDefaultPdbResidue of(PdbResidueIdentifier identifier, String standardResidueName, String modifiedResidueName, Iterable<? extends PdbAtomLine> atoms)
      Construct a new immutable DefaultPdbResidue instance.
      Parameters:
      identifier - The value for the identifier attribute
      standardResidueName - The value for the standardResidueName attribute
      modifiedResidueName - The value for the modifiedResidueName attribute
      atoms - The value for the atoms attribute
      Returns:
      An immutable DefaultPdbResidue instance
    • copyOf

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

      public static ImmutableDefaultPdbResidue.Builder builder()
      Creates a builder for ImmutableDefaultPdbResidue.
       ImmutableDefaultPdbResidue.builder()
          .identifier(pl.poznan.put.pdb.PdbResidueIdentifier) // required identifier
          .standardResidueName(String) // required standardResidueName
          .modifiedResidueName(String) // required modifiedResidueName
          .addAtoms|addAllAtoms(pl.poznan.put.pdb.PdbAtomLine) // atoms elements
          .build();
       
      Returns:
      A new ImmutableDefaultPdbResidue builder