Class ChecksumUtils


  • public class ChecksumUtils
    extends Object
    Utility class for Checksums
    Since:
    24/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • ChecksumUtils

        public ChecksumUtils()
    • Method Detail

      • doesChecksumHaveMethod

        public static boolean doesChecksumHaveMethod​(Checksum checksum,
                                                     String methodId,
                                                     String methodName)
        To check if a checksum does have a specific method
        Parameters:
        checksum - the checksum
        methodId - the checksum MI identifier
        methodName - the checksum method name
        Returns:
        true if the checksum has the method with given name/identifier
      • collectAllChecksumsHavingMethod

        public static Collection<Checksum> collectAllChecksumsHavingMethod​(Collection<? extends Checksum> checksums,
                                                                           String methodId,
                                                                           String methodName)
        Collect all checksum having a specific method
        Parameters:
        checksums - the checksums
        methodId - the checksum MI identifier
        methodName - the checksum method name
        Returns:
        the checksums having the method with given name/identifier
      • collectFirstChecksumWithMethod

        public static Checksum collectFirstChecksumWithMethod​(Collection<? extends Checksum> checksums,
                                                              String methodId,
                                                              String methodName)
        This method will return the first Checksum having this methodId/method name It will return null if there are no Checksums with this method id/name
        Parameters:
        checksums - : the collection of Checksum
        methodId - : the method id to look for
        methodName - : the method name to look for
        Returns:
        the first checksum having this method name/id, null if no Checksum with this method name/id
      • removeAllChecksumWithMethod

        public static void removeAllChecksumWithMethod​(Collection<? extends Checksum> checksums,
                                                       String methodId,
                                                       String methodName)
        Remove all Checksum having this method name/method id from the collection of checksums
        Parameters:
        checksums - : the collection of Checksum
        methodId - : the method id to look for
        methodName - : the method name to look for
      • doesChecksumHaveMethodAndValue

        public static boolean doesChecksumHaveMethodAndValue​(Checksum checksum,
                                                             String methodId,
                                                             String methodName,
                                                             String value)
        To check if a checksum does have a specific method
        Parameters:
        checksum - the checksum
        methodId - the checksum MI identifier
        methodName - the checksum method name
        value - : the checksum value
        Returns:
        true if the checksum has the method with given name/identifier
      • collectAllChecksumsHavingMethodAndValue

        public static Collection<Checksum> collectAllChecksumsHavingMethodAndValue​(Collection<? extends Checksum> checksums,
                                                                                   String methodId,
                                                                                   String methodName,
                                                                                   String value)
        Collect all checksum having a specific method
        Parameters:
        checksums - the checksums
        methodId - the checksum MI identifier
        methodName - the checksum method name
        value - : the checksum value
        Returns:
        a Collection object.
      • collectFirstChecksumWithMethodAndValue

        public static Checksum collectFirstChecksumWithMethodAndValue​(Collection<? extends Checksum> checksums,
                                                                      String methodId,
                                                                      String methodName,
                                                                      String value)
        This method will return the first Checksum having this methodId/method name It will return null if there are no Checksums with this method id/name
        Parameters:
        checksums - : the collection of Checksum
        methodId - : the method id to look for
        methodName - : the method name to look for
        value - : the checksum value
        Returns:
        the first checksum having this method name/id, null if no Checksum with this method name/id
      • removeAllChecksumWithMethod

        public static void removeAllChecksumWithMethod​(Collection<? extends Checksum> checksums,
                                                       String methodId,
                                                       String methodName,
                                                       String value)
        Remove all Checksum having this method name/method id from the collection of checksums
        Parameters:
        checksums - : the collection of Checksum
        methodId - : the method id to look for
        methodName - : the method name to look for
        value - : the value
      • createChecksum

        public static Checksum createChecksum​(String methodName,
                                              String checksum)

        createChecksum

        Parameters:
        methodName - a String object.
        checksum - a String object.
        Returns:
        a Checksum object.
      • createRogid

        public static Checksum createRogid​(String checksum)

        createRogid

        Parameters:
        checksum - a String object.
        Returns:
        a Checksum object.
      • createRigid

        public static Checksum createRigid​(String checksum)

        createRigid

        Parameters:
        checksum - a String object.
        Returns:
        a Checksum object.
      • createStandardInchiKey

        public static Checksum createStandardInchiKey​(String checksum)

        createStandardInchiKey

        Parameters:
        checksum - a String object.
        Returns:
        a Checksum object.
      • createStandardInchi

        public static Checksum createStandardInchi​(String checksum)

        createStandardInchi

        Parameters:
        checksum - a String object.
        Returns:
        a Checksum object.
      • createSmile

        public static Checksum createSmile​(String checksum)

        createSmile

        Parameters:
        checksum - a String object.
        Returns:
        a Checksum object.