• Intro Headers Instructions Macros Commands
  • Fork me on GitHub
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Project Setup
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Bundle Annotations
    • Accessor Properties
    • SPI Annotations
    • Resolving Dependencies
    • Launching
    • Startlevels
    • Testing
    • Testing with Launchpad
    • Packaging Applications
    • JPMS Libraries
    • Wrapping Libraries to OSGi Bundles
    • Generating Documentation
    • Commands
    • For Developers
    • Tips for Windows users
    • Tools bound to bnd
    • Headers
    • Instruction Reference
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Plugins
    • External Plugins
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • uniq (';' LIST )*

    Split all the given lists on their commas, combine them in one list and remove any duplicates. The ordering is not preserved, see [${sort}][#sort] For example:

    ${unique; 1,2,3,1,2; 1,2,4 } ~ “2,4,3,1”
    static String	_uniqHelp	= "${uniq;<list> ...}";
    
    public String _uniq(String args[]) {
    	verifyCommand(args, _uniqHelp, null, 1, Integer.MAX_VALUE);
    	Set<String> set = new LinkedHashSet<String>();
    	for (int i = 1; i < args.length; i++) {
    		Processor.split(args[i], set);
    	}
    	return Processor.join(set, ",");
    }
    
    • GitHub