Class VariableList

java.lang.Object
com.pixelmonmod.pixelmon.api.util.VariableList

public class VariableList extends Object
A list of the variables stored for things such as BuildableInteractionConditions
  • Field Details

  • Constructor Details

    • VariableList

      protected VariableList(List<Object> objects)
  • Method Details

    • of

      public static VariableList of()
      Creates an empty VariableList
      Returns:
      The list
    • of

      public static <T> VariableList of(List<T> objects)
      Creates a VariableList with the given objects
      Parameters:
      objects - The objects
      Returns:
      The list
    • get

      public <T> T get(int index)
      Gets the object at the index
      Type Parameters:
      T - The type
      Parameters:
      index - The index
      Returns:
      The value
    • get

      public <T> T get(int index, Class<T> clazz)
      Gets the object for the given class at the index
      Type Parameters:
      T - The type
      Parameters:
      index - The index
      clazz - The class
      Returns:
      The value
    • getProvider

      public <T> DataProvider<T> getProvider(int index)
      Gets the DataProvider at the index
      This will throw a ClassCastException if the object at the specified index is not a DataProvider
      Type Parameters:
      T - The type
      Parameters:
      index - The index
      Returns:
      The value
    • getProvider

      public <T> DataProvider<T> getProvider(int index, Class<T> clazz)
      Gets the DataProvider at the index
      This will throw a ClassCastException if the object at the specified index is not a DataProvider
      Type Parameters:
      T - The type
      Parameters:
      index - The index
      clazz - The class
      Returns:
      The value