public static String tokenizerToJson ( Tokenizer tokenizer ) { Map < String , String > settingsMap = new HashMap < String , String > ( ) ; if ( tokenizer != null ) { settingsMap . put ( TOKENIZE , tokenizer . tokenizerName ) ; // safe to store args even if they are null settingsMap . put ( TOKENIZE_ARGS , tokenizer . tokenizerArguments ) ; } return JSONUtils . serializeAsString ( settingsMap ) ; }
Convert Tokenizer into serialized options or empty map if null