java.lang.Object
java.lang.Enum<Flavor>
org.apache.juneau.petstore.console.dev.flavors.Flavor
All Implemented Interfaces:
Serializable, Comparable<Flavor>, Constable

public enum Flavor extends Enum<Flavor>
The four petstore rendering flavors shown under Developer > Rendering flavors.
Example:

// The console page for one flavor. View page = Flavor.of("mustache").page();

  • Enum Constant Details

    • HTML

      public static final Flavor HTML
      HTML5 bean builder, serialized by HtmlSerializer.
    • FREEMARKER

      public static final Flavor FREEMARKER
      FreeMarker view rendering.
    • MUSTACHE

      public static final Flavor MUSTACHE
      Mustache view rendering.
    • REACT

      public static final Flavor REACT
      The standalone React app at /petstore-ui.
  • Method Details

    • values

      public static Flavor[] 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 Flavor 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
    • of

      public static Flavor of(String id)
      Looks up a flavor by its URL id.
      Parameters:
      id - The id, for example "html".
      Returns:
      The flavor.
      Throws:
      NotFound - If the id names no flavor.
    • id

      public String id()
      Returns:
      The URL id.
    • label

      public String label()
      Returns:
      The nav label, also the caption card's title.
    • caption

      public String caption()
      Returns:
      The caption shown above the rendered output.
    • sourceUrl

      public String sourceUrl()
      Returns:
      The GitHub URL of the class that renders this flavor.
    • page

      public View page(RestRequest req)
      The console page for this flavor, from its builder twin on ?builder.
      Parameters:
      req - The request.
      Returns:
      The page.
    • page

      public View page()
      Returns:
      The console page for this flavor.