Class Muling


  • public class Muling
    extends java.lang.Object
    Utility class for performing operations on a list of mules.
    • Constructor Summary

      Constructors 
      Constructor Description
      Muling()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean containsOwnedItem​(java.util.List<Mule> mules, int id)
      Checks if any of the Mules in the given List have an owned item with the specified id.
      static boolean containsOwnedItem​(java.util.List<Mule> mules, java.lang.String name)
      Checks if any of the Mules in the given List have an owned item with the specified name.
      static boolean containsRemainingItem​(java.util.List<Mule> mules, int id)
      Checks if any of the Mules in the list have a remaining item with the given id.
      static boolean containsRemainingItem​(java.util.List<Mule> mules, java.lang.String name)
      Checks if any of the mules have a remaining item with the specified name.
      static int countOwnedItems​(java.util.List<Mule> mules, int... ids)
      Counts the total number of owned items with given ids in the list of Mules.
      static int countOwnedItems​(java.util.List<Mule> mules, java.lang.String... names)
      Counts the total quantity of owned items by the given list of Mules, filtered by the provided item names.
      static int countRemainingItems​(java.util.List<Mule> mules, int... ids)
      Counts the total quantity of remaining items with the specified ids across all Mules.
      static int countRemainingItems​(java.util.List<Mule> mules, java.lang.String... names)
      Returns the total quantity of remaining items owned by the given list of mules with names matching the provided strings.
      static java.util.List<Mule> getMules()
      Retrieves a list of Mules.
      • Methods inherited from class java.lang.Object

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

      • Muling

        public Muling()
    • Method Detail

      • getMules

        public static java.util.List<Mule> getMules()
                                             throws java.lang.Exception
        Retrieves a list of Mules.
        Returns:
        a list of Mules retrieved from the server
        Throws:
        java.lang.Exception
      • containsOwnedItem

        public static boolean containsOwnedItem​(java.util.List<Mule> mules,
                                                int id)
        Checks if any of the Mules in the given List have an owned item with the specified id.
        Parameters:
        mules - the List of Mules to search through
        id - the id of the item to check for
        Returns:
        true if any Mule owns an item with the specified id, false otherwise
      • containsRemainingItem

        public static boolean containsRemainingItem​(java.util.List<Mule> mules,
                                                    int id)
        Checks if any of the Mules in the list have a remaining item with the given id.
        Parameters:
        mules - the list of Mules to check
        id - the id of the item to search for
        Returns:
        true if a Mule contains a remaining item with the given id, false otherwise
      • containsOwnedItem

        public static boolean containsOwnedItem​(java.util.List<Mule> mules,
                                                java.lang.String name)
        Checks if any of the Mules in the given List have an owned item with the specified name.
        Parameters:
        mules - the List of Mules to search in
        name - the name of the item to look for
        Returns:
        true if any Mule has an owned item with the specified name, false otherwise
      • containsRemainingItem

        public static boolean containsRemainingItem​(java.util.List<Mule> mules,
                                                    java.lang.String name)
        Checks if any of the mules have a remaining item with the specified name.
        Parameters:
        mules - the list of mules to check
        name - the name of the item to search for
        Returns:
        true if a mule has a remaining item with the specified name, false otherwise
      • countOwnedItems

        public static int countOwnedItems​(java.util.List<Mule> mules,
                                          int... ids)
        Counts the total number of owned items with given ids in the list of Mules.
        Parameters:
        mules - the list of Mules to search for owned items
        ids - the variable number of item ids to search for
        Returns:
        the total count of owned items with the given ids
      • countRemainingItems

        public static int countRemainingItems​(java.util.List<Mule> mules,
                                              int... ids)
        Counts the total quantity of remaining items with the specified ids across all Mules.
        Parameters:
        mules - the list of Mules
        ids - the item ids to search for
        Returns:
        the total quantity of remaining items with the specified ids
      • countOwnedItems

        public static int countOwnedItems​(java.util.List<Mule> mules,
                                          java.lang.String... names)
        Counts the total quantity of owned items by the given list of Mules, filtered by the provided item names.
        Parameters:
        mules - the list of Mules to check for owned items
        names - the item names to filter the owned items by
        Returns:
        the total quantity of owned items with matching names
      • countRemainingItems

        public static int countRemainingItems​(java.util.List<Mule> mules,
                                              java.lang.String... names)
        Returns the total quantity of remaining items owned by the given list of mules with names matching the provided strings.
        Parameters:
        mules - the list of mules to check for remaining items
        names - the names to match against the item composites
        Returns:
        the total quantity of remaining items with matching names