Interface Icon


@Immutable public interface Icon
An icon entry for a tool or resource, pointing to an image resource.

All fields except src are optional. Sizes use the conventional format (e.g. "16x16", "32x32"), and theme distinguishes light vs. dark variants.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for Icon.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new builder for Icon.
    default void
    Validates that the icon source is not blank.
    @Nullable String
    MIME type of the icon image (e.g.
    static Icon
    of(String src, @Nullable String mimeType, @Nullable List<String> sizes, @Nullable String theme)
    Creates an icon with the given values.
    @Nullable List<String>
    Conventional size labels (e.g.
    src()
    Image URL or data URI for this icon.
    @Nullable String
    Theme variant this icon is designed for.
  • Method Details

    • src

      @Redacted String src()
      Image URL or data URI for this icon.
      Returns:
      the icon source, never blank
    • mimeType

      @Nullable String mimeType()
      MIME type of the icon image (e.g. "image/png").
      Returns:
      the MIME type, or null when unknown
    • sizes

      @Nullable List<String> sizes()
      Conventional size labels (e.g. ["16x16", "32x32"]).
      Returns:
      the size labels, or null when unspecified
    • theme

      @Nullable String theme()
      Theme variant this icon is designed for.
      Returns:
      "light", "dark", or null when universal
    • check

      @Check default void check()
      Validates that the icon source is not blank.
      Throws:
      IllegalArgumentException - if src is blank
    • builder

      static Icon.Builder builder()
      Creates a new builder for Icon.
      Returns:
      a new builder
    • of

      static Icon of(String src, @Nullable String mimeType, @Nullable List<String> sizes, @Nullable String theme)
      Creates an icon with the given values.
      Parameters:
      src - image URL or data URI
      mimeType - image MIME type, or null
      sizes - conventional size labels, or null
      theme - theme variant, or null
      Returns:
      the new icon