Class RawMessageHelper


  • public class RawMessageHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<RawMessage> filter​(java.util.Collection<RawMessage> messages, java.util.Map<java.lang.String,​? extends java.lang.Iterable<java.lang.String>> params)  
      java.util.Collection<RawMessage> filterObjects​(java.util.Collection<RawMessage> messages, java.util.Map<java.lang.String,​? extends java.lang.Iterable<?>> params)  
      java.lang.Object getValue​(RawMessage msg, java.lang.String field)  
      java.lang.Object getValue​(RawMessage msg, java.lang.String field, java.lang.Object notFoundValue)  
      java.util.Map<java.lang.String,​java.lang.Object> getValues​(RawMessage msg)  
      boolean isAccepted​(RawMessage msg, java.util.Map<java.lang.String,​? extends java.lang.Iterable<java.lang.String>> params)
      Checks whether message is accepted with given parameters.
      boolean isAcceptedObjects​(RawMessage msg, java.util.Map<java.lang.String,​? extends java.lang.Iterable<?>> params)  
      static java.lang.Object parseValue​(DataType type, java.lang.String s)  
      static void setValue​(UnboundEncoder encoder, NonStaticFieldInfo info, java.lang.Object value)  
      void setValues​(RawMessage msg, java.util.Map<java.lang.String,​java.lang.Object> values)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RawMessageHelper

        public RawMessageHelper()
    • Method Detail

      • setValues

        public void setValues​(RawMessage msg,
                              java.util.Map<java.lang.String,​java.lang.Object> values)
      • getValues

        public java.util.Map<java.lang.String,​java.lang.Object> getValues​(RawMessage msg)
      • parseValue

        public static java.lang.Object parseValue​(DataType type,
                                                  java.lang.String s)
      • getValue

        public java.lang.Object getValue​(RawMessage msg,
                                         java.lang.String field,
                                         java.lang.Object notFoundValue)
      • isAccepted

        public boolean isAccepted​(RawMessage msg,
                                  java.util.Map<java.lang.String,​? extends java.lang.Iterable<java.lang.String>> params)
        Checks whether message is accepted with given parameters.

        Example. We've got 3 messages: 1) {a:1,b:2,c:4}, 2) {a:1,b:4,c:3}, 3) {a:1,c:3,d:5}.
        Also we've got params: {a:[1], b:[1,2,3]}.

        • 1st message will be accepted, cause a=1 and b=2.
        • 2nd message won't be accepted, cause a=1, but b=4.
        • 3rd message won't be accepted, cause it doesn't contain field b.
        Parameters:
        msg - raw message
        params - map with params in String form
      • isAcceptedObjects

        public boolean isAcceptedObjects​(RawMessage msg,
                                         java.util.Map<java.lang.String,​? extends java.lang.Iterable<?>> params)
      • filter

        public java.util.Collection<RawMessage> filter​(java.util.Collection<RawMessage> messages,
                                                       java.util.Map<java.lang.String,​? extends java.lang.Iterable<java.lang.String>> params)
      • filterObjects

        public java.util.Collection<RawMessage> filterObjects​(java.util.Collection<RawMessage> messages,
                                                              java.util.Map<java.lang.String,​? extends java.lang.Iterable<?>> params)