• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • Introduction
      • How to install bnd
      • Guided Tour Workspace & Projects
      • bnd / bndlib Features and JAR Wrapping Techniques
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Concepts
      • Background
      • Best practices
    • Build and Development
      • Build
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • bnd CLI Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • max (';' LIST )*

    Prev Next
    Macro
    Find the maximum string in one or more lists

    Summary

    The max macro compares strings lexicographically using Java’s String.compareTo() and returns the maximum (highest) value.

    Syntax

    ${max;<list>[;<list>...]}
    

    Parameters

    • list - One or more semicolon-separated lists of strings

    Behavior

    • Compares strings lexicographically
    • Case-sensitive comparison
    • Returns the highest string value
    • Uses standard Java string ordering

    Examples

    Find maximum string:

    ${max;apple,banana,cherry}
    # Returns: "cherry"
    

    Multiple lists:

    ${max;abc,xyz;def,mno}
    # Returns: "xyz"
    

    Numeric strings (lexicographic):

    ${max;1,10,2,20}
    # Returns: "20" (lexicographic, not numeric)
    

    Use Cases

    • Finding highest string value
    • String comparison
    • Alphabetic sorting (last)
    • String selection
    • Data analysis

    Notes

    • Lexicographic (dictionary) ordering
    • Case-sensitive (“Z” < “a”)
    • Not numeric comparison
    • For numeric max, use proper number comparison
    • See also: ${min} for minimum
    • See also: ${vmax} for version comparison
    • See also: ${nmax} for numeric comparison

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home