Class Pojos


  • public class Pojos
    extends java.lang.Object
    Utility methods for the Pojo DataObjects
    • Constructor Summary

      Constructors 
      Constructor Description
      Pojos()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Collection<java.lang.Long> extractIds​(java.util.Collection<? extends DataObject> pojos)
      Extract the (distinct) ids from a collection of DataObjects
      static boolean hasID​(DataObject obj)
      Checks if a DataObject Pojo is not null and has an ID
      static <T extends DataObject>
      java.util.Collection<T>
      relativeComplement​(java.util.Collection<T> coll1, java.util.Collection<T> coll2)
      Get the relative complement of coll1 in coll2
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Pojos

        public Pojos()
    • Method Detail

      • extractIds

        public static java.util.Collection<java.lang.Long> extractIds​(java.util.Collection<? extends DataObject> pojos)
        Extract the (distinct) ids from a collection of DataObjects
        Parameters:
        pojos - The DataObjects
        Returns:
        The ids
      • relativeComplement

        public static <T extends DataObject> java.util.Collection<T> relativeComplement​(java.util.Collection<T> coll1,
                                                                                        java.util.Collection<T> coll2)
        Get the relative complement of coll1 in coll2
        Parameters:
        coll1 - The collection
        coll2 - The other collection
        Returns:
        The elements of coll2 which are not part of coll1
      • hasID

        public static boolean hasID​(DataObject obj)
        Checks if a DataObject Pojo is not null and has an ID
        Parameters:
        obj - The DataObject
        Returns:
        See above.