Enum Class Badge.Variant

java.lang.Object
java.lang.Enum<Badge.Variant>
no.ntnu.principes.components.primary.Badge.Variant
All Implemented Interfaces:
Serializable, Comparable<Badge.Variant>, Constable
Enclosing class:
Badge

public static enum Badge.Variant extends Enum<Badge.Variant>
Defines the available visual styling variants for UI components such as badges and buttons. Each variant corresponds to a specific pre-defined appearance, including color and border styles, used to differentiate component types and states.

Supported variants:

  • DEFAULT - The standard appearance.
  • OUTLINED - A visual style with an outline border.
  • INFO - Style intended for informational components.
  • WARNING - Style indicating warnings or caution.
  • SUCCESS - Style representing success states.
  • DANGER - Style indicating errors or critical states.
  • PRIMARY - A primary style for emphasizing components.

  • Enum Constant Details

  • Method Details

    • values

      public static Badge.Variant[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Badge.Variant valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getWeightVariant

      public static Badge.Variant getWeightVariant(int weight)
      Returns the badge variant based on a 1-6 weight.
      Parameters:
      weight - the weight of the variant, which should be between 1 and 6.
      Returns:
      the badge variant corresponding to the weight.