Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.collections.processor
Interface KeyValueOutputFilter

All Known Implementing Classes:
KeyValueAbstractOutputFilter

public interface KeyValueOutputFilter

Interface for custom filtering of values inside of KeyValueCollection's on log printing or any other external representation of KVLists.

Filter implementation is expected to be stateless, so it can be reused by different "filter collections". The state (if there is one) should be maintained by collection itself.

See Also:
KeyValueAbstractOutputFilter

Method Summary
 java.lang.String appendKeyValuePair(java.lang.StringBuffer buf, java.lang.String key, java.lang.Object value, KeyValuePrinterContext context)
          "Entry point" method for key-value pair printing.
 void configure(KeyValueCollection options)
          Configuration for filter.
 boolean isFilteredOut(java.lang.String key, java.lang.Object value, KeyValuePrinterContext context)
          Evaluates that some key-value pair should be skipped on log print or not.
 

Method Detail

configure

void configure(KeyValueCollection options)
Configuration for filter.

Parameters:
options - Collection with configuration data

isFilteredOut

boolean isFilteredOut(java.lang.String key,
                      java.lang.Object value,
                      KeyValuePrinterContext context)
Evaluates that some key-value pair should be skipped on log print or not. Printing logic is following:
     if (! isFilteredOut(key, value, context)) {
         String rest = appendKeyValuePair(
             buffer, key, value, context
         );
         
         if (rest != null) {
             buffer.append(rest);
         }
     }
 

Parameters:
key - Pair string key
value - Pair value
context - Printer context
Returns:
false if key-value should be printed, or true if key-value should be skipped

appendKeyValuePair

java.lang.String appendKeyValuePair(java.lang.StringBuffer buf,
                                    java.lang.String key,
                                    java.lang.Object value,
                                    KeyValuePrinterContext context)
"Entry point" method for key-value pair printing. It is called right after false value return from isFilteredOut(...).

Parameters:
buf - Output buffer
key - Pair string key
value - Pair value
context - Printer context
Returns:
value for delayed output or null

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.