Package psidev.psi.mi.jami.utils
Class ChecksumUtils
- java.lang.Object
-
- psidev.psi.mi.jami.utils.ChecksumUtils
-
public class ChecksumUtils extends Object
Utility class for Checksums- Since:
24/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ChecksumUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<Checksum>
collectAllChecksumsHavingMethod(Collection<? extends Checksum> checksums, String methodId, String methodName)
Collect all checksum having a specific methodstatic Collection<Checksum>
collectAllChecksumsHavingMethodAndValue(Collection<? extends Checksum> checksums, String methodId, String methodName, String value)
Collect all checksum having a specific methodstatic 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/namestatic 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/namestatic Checksum
createChecksum(String methodName, String checksum)
createChecksumstatic Checksum
createChecksum(String methodName, String methodMi, String checksum)
createChecksumstatic Checksum
createRigid(String checksum)
createRigidstatic Checksum
createRogid(String checksum)
createRogidstatic Checksum
createSmile(String checksum)
createSmilestatic Checksum
createStandardInchi(String checksum)
createStandardInchistatic Checksum
createStandardInchiKey(String checksum)
createStandardInchiKeystatic boolean
doesChecksumHaveMethod(Checksum checksum, String methodId, String methodName)
To check if a checksum does have a specific methodstatic boolean
doesChecksumHaveMethodAndValue(Checksum checksum, String methodId, String methodName, String value)
To check if a checksum does have a specific methodstatic void
removeAllChecksumWithMethod(Collection<? extends Checksum> checksums, String methodId, String methodName)
Remove all Checksum having this method name/method id from the collection of checksumsstatic 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
-
-
-
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 checksummethodId
- the checksum MI identifiermethodName
- 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 checksumsmethodId
- the checksum MI identifiermethodName
- 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 ChecksummethodId
- : the method id to look formethodName
- : 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 ChecksummethodId
- : the method id to look formethodName
- : 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 checksummethodId
- the checksum MI identifiermethodName
- the checksum method namevalue
- : 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 checksumsmethodId
- the checksum MI identifiermethodName
- the checksum method namevalue
- : 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 ChecksummethodId
- : the method id to look formethodName
- : the method name to look forvalue
- : 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 ChecksummethodId
- : the method id to look formethodName
- : the method name to look forvalue
- : the value
-
createChecksum
public static Checksum createChecksum(String methodName, String methodMi, String checksum)
createChecksum
-
createChecksum
public static Checksum createChecksum(String methodName, String checksum)
createChecksum
-
createStandardInchiKey
public static Checksum createStandardInchiKey(String checksum)
createStandardInchiKey
-
createStandardInchi
public static Checksum createStandardInchi(String checksum)
createStandardInchi
-
-