Interface Attributes


public interface Attributes
Attribute name constants
  • Field Details

  • Method Details

    • floatAttribute

      static Result<Float,String> floatAttribute(String value, float min, float max)
      Parses a float attribute value.

      If the specified value cannot be parsed into a float, an erroneous result with the error "Invalid number" is returned.

      If the number is parsed successfully, then it is clamped according to the min and max parameters.

      Parameters:
      value - Value to parse from
      min - Minimum value
      max - Maximum value
      Returns:
      Parsed float result
    • intAttribute

      static int intAttribute(String value, int min, int max, int fb)
      Parses an attribute's string value into an integer.
      Parameters:
      value - Attribute value
      min - Minimum parsed value
      max - Maximum parsed value
      fb - Fallback value if attribute value is empty or null
      Returns:
      Clamped parsed value, or fallback
    • boolAttribute

      static boolean boolAttribute(@Nullable @Nullable String value, boolean fallback)