public static String getDisplayString ( final String longArgName , final TaggedArgument taggedArg ) { Utils . nonNull ( longArgName ) ; Utils . nonNull ( taggedArg ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( longArgName ) ; if ( taggedArg . getTag ( ) != null ) { sb . append ( ARGUMENT_TAG_NAME_SEPARATOR ) ; sb . append ( taggedArg . getTag ( ) ) ; if ( taggedArg . getTagAttributes ( ) != null ) { taggedArg . getTagAttributes ( ) . entrySet ( ) . stream ( ) . forEach ( entry -> { sb . append ( ARGUMENT_KEY_VALUE_PAIR_DELIMITER ) ; sb . append ( entry . getKey ( ) . toString ( ) ) ; sb . append ( ARGUMENT_KEY_VALUE_SEPARATOR ) ; sb . append ( entry . getValue ( ) . toString ( ) ) ; } ) ; } } return sb . toString ( ) ; }
Given a TaggedArgument implementation and a long argument name return a string representation of argument including the tag and attributes for display purposes .