Class ParameterUtils

java.lang.Object
software.bluelib.utils.variant.ParameterUtils

public class ParameterUtils extends Object
A public final class that provides utility methods for managing custom parameters associated with entity variants.

This class contains methods to retrieve and handle custom parameters for variants, enabling the building and connecting of parameters to specific variants.

Key Methods:

Since:
1.0.0
See Also:
  • Method Details

    • getAllEntities

      public static Set<String> getAllEntities()
      A public static Set<String> that retrieves all entities from the variant loader.

      This method accesses the VariantLoader to fetch all the entities present in the AllVariants map.

      Returns:
      A Set<String> containing all the entity names from the variant loader.
      Since:
      1.3.0
    • getVariantsOfEntity

      public static Set<String> getVariantsOfEntity(String pEntityName)
      A public static Set<String> that retrieves all variants for a specific entity.

      This method checks the provided pEntityName and returns the corresponding variants from the variant data.

      Parameters:
      pEntityName - String - The name of the entity for which variants are to be retrieved.
      Returns:
      A Set<String> of variant names for the given entity, or null if the entity does not exist.
      Since:
      1.3.0
    • getCustomParameterForVariant

      public static com.google.gson.JsonElement getCustomParameterForVariant(String pEntityName, String pVariantName, String pParameter)
      A public static String method that retrieves the value of a custom parameter for a specific variant.

      This method accesses the variant data for a specified entity and variant and retrieves the value of a custom parameter.

      The method checks if the parameter exists and returns its value as a String.

      Parameters:
      pEntityName - String - The name of the entity whose variant parameter is being queried.
      pVariantName - String - The name of the variant whose parameter is being queried.
      pParameter - String - The name of the custom parameter to retrieve.
      Returns:
      The value of the custom parameter as a String, or null if not found.
      Since:
      1.3.0