Parses given string following this format
https://help.nexmo.com/hc/en-us/articles/204015663-What-is-Nexmo-s-SMPP-DLR-format-

@param message
@return the parsed DLR
490635
@Override
    public DLRPayload parseMessage(String message) {
        //"id:XXXXXXXXXX sub:001 dlvrd:000 submit date:YYMMDDHHMM done date:YYMMDDHHMM stat:ZZZZZZZ err:YYY text:none
        DLRPayload dlr = new DLRPayload();

        final String messageId = parseTagValue(message, ID_TAG);
        dlr.setId(messageId);

        final String submit_date = parseTagValue(message, SUBMIT_TAG);
        DateTime parsedDate = parseDate(submit_date);
        dlr.setSubmitDate(parsedDate);

        final String done_date = parseTagValue(message, DONE_TAG);
        DateTime doneDate = parseDate(done_date);
        dlr.setDoneDate(doneDate);

        final String stat = parseTagValue(message, STAT_TAG);
        Status parsedStatus = parseRestcommStatus(stat);
        dlr.setStat(parsedStatus);

        final String err = parseTagValue(message, ERR_TAG);
        MessageError parsedError = parseRestcommErrorCode(err);
        dlr.setErr(parsedError);

        final String sub = parseTagValue(message, SUB_TAG);
        dlr.setSub(sub);

        final String dlv = parseTagValue(message, DLVRD_TAG);
        dlr.setDlvrd(dlv);

        if (logger.isDebugEnabled()) {
            logger.debug("Parsed DLR is:" + dlr);
        }
        return dlr;
    }
872147
public String createMessageData(String message) {

		messageStringBuffer.delete(0, messageStringBuffer.length());

		// Create the PRI part
		messageStringBuffer.append('<');
		int priority = facility * 8 + severity;
		messageStringBuffer.append(priority);
		messageStringBuffer.append('>');

		// Create the HEADER part.
		if (header) {
			// Add the TIMESTAMP field of the HEADER
			// Time format is "Mmm dd hh:mm:ss". For more info see rfc3164.
			long currentTime = System.currentTimeMillis();
			calendar.setTime(new Date(currentTime));

			messageStringBuffer.append(SyslogMessage.MONTHS[calendar
					.get(Calendar.MONTH)]);
			messageStringBuffer.append(' ');

			int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
			if (dayOfMonth < SyslogMessage.TEN) {
				messageStringBuffer.append('0');
			}
			messageStringBuffer.append(dayOfMonth);
			messageStringBuffer.append(' ');

			int hour = calendar.get(Calendar.HOUR_OF_DAY);
			if (hour < SyslogMessage.TEN) {
				messageStringBuffer.append('0');
			}
			messageStringBuffer.append(hour);
			messageStringBuffer.append(':');

			int minute = calendar.get(Calendar.MINUTE);
			if (minute < SyslogMessage.TEN) {
				messageStringBuffer.append('0');
			}
			messageStringBuffer.append(minute);
			messageStringBuffer.append(':');

			int second = calendar.get(Calendar.SECOND);
			if (second < SyslogMessage.TEN) {
				messageStringBuffer.append('0');
			}
			messageStringBuffer.append(second);
			messageStringBuffer.append(' ');

			// Add the HOSTNAME part of the message
			messageStringBuffer.append(hostname);
		}

		// Create the MSG part.
		messageStringBuffer.append(' ');
		messageStringBuffer.append(tag);
		messageStringBuffer.append(": ");
		messageStringBuffer.append(message);

		return messageStringBuffer.toString();
	}
554661
public static String msgToString(SIBusMessage message)
   {
     if (message == null) return STRING_NULL;
     return message + "[" + message.getSystemMessageId() + "]";
   }
1020343
public String mac(String message) {
        return Util.toHexString(mac(message.getBytes(StandardCharsets.UTF_8)));
    }
462821
protected String getMessage(Message message) {
    switch(message) {
      case CHECK:
        return "This conversion doesn't seem right. Do you want to correct it automatically?";
      case SUGGESTION:
        return "Writing for an international audience? Consider adding the metric equivalent.";
      case CHECK_UNKNOWN_UNIT:
        return "This conversion doesn't seem right, unable to recognize the used unit.";
      case UNIT_MISMATCH:
        return "These units don't seem to be compatible.";
      default:
        throw new RuntimeException("Unknown message type: " + message);
    }
  }
1268135
private FormatString[] parse(String s) {
        ArrayList<FormatString> al = new ArrayList<>();
        for (int i = 0, len = s.length(); i < len; ) {
            int nextPercent = s.indexOf('%', i);
            if (s.charAt(i) != '%') {
                // This is plain-text part, find the maximal plain-text
                // sequence and store it.
                int plainTextStart = i;
                int plainTextEnd = (nextPercent == -1) ? len: nextPercent;
                al.add(new FixedString(s.substring(plainTextStart,
                                                   plainTextEnd)));
                i = plainTextEnd;
            } else {
                // We have a format specifier
                FormatSpecifierParser fsp = new FormatSpecifierParser(s, i + 1);
                al.add(fsp.getFormatSpecifier());
                i = fsp.getEndIdx();
            }
        }
        return al.toArray(new FormatString[al.size()]);
    }
704053
public <Message extends PMessage<Message, Field>, Field extends PField>
    String format(Message message) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        formatTo(out, message);
        return new String(out.toByteArray(), StandardCharsets.UTF_8);
    }
32761
function parseMessage(message) {
  const parts = message.content.split(' ');
  const command = parts[1];
  const args = parts.slice(2);

  if (typeof Commands[command] === 'function') {
    // @TODO We could check the command validity here
    return { command, args };
  } else {
    return null;
  }
}
1072663
protected String formatMessage(String message, Object[] parameters) {
        String formatted;
        if (printfStyle) {
            formatted = String.format(message, parameters);
        } else {
            formatted = MessageFormat.format(message, parameters);
        }
        return formatted;
    }
890649
private static String formatString(String message, Object[] values) {
        if (Checker.isNotEmpty(message)) {
            if (Checker.isNotEmpty(values)) {
                return StrUtil.format(String.format(message, values), values);
            }
            return message;
        }
        return ValueConsts.EMPTY_STRING;
    }
520050
public static byte[] stringMessage(String message) {
        byte[] bytes = message.getBytes();
        byte[] result = new byte[bytes.length * 2 + 3];
        result[0] = START_SYSEX;
        result[1] = STRING_DATA;
        result[result.length - 1] = END_SYSEX;
        for (int i = 0; i < bytes.length; i++) {
            byte b = bytes[i];
            result[i * 2 + 2] = (byte) (b & 0x7F);
            result[i * 2 + 3] = (byte) ((b >> 7) & 0x7F);
        }
        return result;
    }
962995
public static String md5(final String message) {
        byte[] res;

        try {
            MessageDigest instance = MessageDigest.getInstance("MD5");
            instance.reset();
            instance.update(message.getBytes());
            res = instance.digest();

        } catch (final NoSuchAlgorithmException ex) {
            throw new RuntimeException(ex);
        }

        StringBuilder hexString = new StringBuilder();
        for (byte resByte : res) {
            hexString.append(Integer.toString((resByte & 0xff) + 0x100, 16).substring(1));
        }

        return hexString.toString();
    }
843384
String format(final String message, final Object[] arguments) {
		StringBuilder builder = new StringBuilder(INITIAL_STRING_BUFFER_CAPACITY);

		int argumentIndex = 0;
		int start = 0;
		int openingCurlyBrackets = 0;

		for (int index = 0; index < message.length(); ++index) {
			char character = message.charAt(index);
			if (character == '{') {
				if (openingCurlyBrackets++ == 0 && start < index) {
					builder.append(message, start, index);
					start = index;
				}
			} else if (character == '}' && openingCurlyBrackets > 0) {
				if (--openingCurlyBrackets == 0) {
					if (argumentIndex < arguments.length) {
						Object argument = arguments[argumentIndex++];
						if (argument instanceof Supplier) {
							argument = ((Supplier<?>) argument).get();
						}

						if (index == start + 1) {
							builder.append(argument);
						} else {
							builder.append(format(message.substring(start + 1, index), argument));
						}
					} else {
						builder.append(message, start, index + 1);
					}

					start = index + 1;
				}
			}
		}

		if (start < message.length()) {
			builder.append(message, start, message.length());
		}

		return builder.toString();
	}
627515
protected javax.jms.Message convertToJMSMessage(Message message) throws JMSException {
        MessageAttributeValue messageTypeAttribute = message.getMessageAttributes().get(
                SQSMessage.JMS_SQS_MESSAGE_TYPE);
        javax.jms.Message jmsMessage = null;
        if (messageTypeAttribute == null) {
            jmsMessage = new SQSTextMessage(acknowledger, queueUrl, message);
        } else {
            String messageType = messageTypeAttribute.getStringValue();
            if (SQSMessage.BYTE_MESSAGE_TYPE.equals(messageType)) {
                try {
                    jmsMessage = new SQSBytesMessage(acknowledger, queueUrl, message);
                } catch (JMSException e) {
                    LOG.warn("MessageReceiptHandle - " + message.getReceiptHandle() +
                             "cannot be serialized to BytesMessage", e);
                    throw e;
                }
            } else if (SQSMessage.OBJECT_MESSAGE_TYPE.equals(messageType)) {
                jmsMessage = new SQSObjectMessage(acknowledger, queueUrl, message);
            } else if (SQSMessage.TEXT_MESSAGE_TYPE.equals(messageType)) {
                jmsMessage = new SQSTextMessage(acknowledger, queueUrl, message);
            } else {
                throw new JMSException("Not a supported JMS message type");
            }
        }
        
        jmsMessage.setJMSDestination(sqsDestination);
        
        MessageAttributeValue replyToQueueNameAttribute = message.getMessageAttributes().get(
                SQSMessage.JMS_SQS_REPLY_TO_QUEUE_NAME);
        MessageAttributeValue replyToQueueUrlAttribute = message.getMessageAttributes().get(
                SQSMessage.JMS_SQS_REPLY_TO_QUEUE_URL);
        if (replyToQueueNameAttribute != null && replyToQueueUrlAttribute != null) {
            String replyToQueueUrl = replyToQueueUrlAttribute.getStringValue();
            String replyToQueueName = replyToQueueNameAttribute.getStringValue();
            Destination replyToQueue = new SQSQueueDestination(replyToQueueName, replyToQueueUrl);
            jmsMessage.setJMSReplyTo(replyToQueue);
        }
        
        MessageAttributeValue correlationIdAttribute = message.getMessageAttributes().get(
                SQSMessage.JMS_SQS_CORRELATION_ID);
        if (correlationIdAttribute != null) {
                jmsMessage.setJMSCorrelationID(correlationIdAttribute.getStringValue());
        }
        
        return jmsMessage;
    }
773803
private String format(String message, Object[] params) {
        if (params.length == 0) {
            return message;
        } else if (params.length == 1 && params[0] instanceof Throwable) {
            // We print only the message here since breaking exception will bubble up
            // anyway
            return message + ": " + params[0].toString();
        } else {
            return String.format(message, params);
        }
    }
251552
@Override
  public <T> T decode(Message message, java.lang.Class<T> yourDomainMessageObject) throws RecoderException {
    Object rc = null;
    ClassInfo c = storage.getClassInfo(yourDomainMessageObject);
    CommandDscr cd = c.getAnnotation(CommandDscr.class);
    if (cd != null) {
      try {
        if (message.getCommandCode() != cd.code()) {
          throw new IllegalArgumentException("Invalid message code " + message.getCommandCode());
        }
        if (message.getApplicationId() != 0 && message.getApplicationId() != cd.appId()) {
          throw new IllegalArgumentException("Invalid Application-Id " + message.getApplicationId());
        }
        for (CommandFlag f : cd.flags()) {
          switch (f) {
            case E:
              if (!message.isError()) {
                throw new IllegalArgumentException("Flag e is not set");
              }
              break;
            case P:
              if (!message.isProxiable()) {
                throw new IllegalArgumentException("Flag p is not set");
              }
              break;
            case R:
              if (!message.isRequest()) {
                throw new IllegalArgumentException("Flag m is not set");
              }
              break;
            case T:
              if (!message.isReTransmitted()) {
                throw new IllegalArgumentException("Flag t is not set");
              }
              break;
          }
        }
        // Find max constructor + lost avp set by setters
        int cacount = 0;
        Constructor<?> cm = null;
        Map<String, Class<?>> cmargs = new HashMap<String, Class<?>>();
        for (ConstructorInfo ci : c.getConstructorsInfo()) {
          if (ci.getAnnotation(Setter.class) != null) {
            // check params - all params must have avp annotation
            Class<?>[] params = ci.getConstructor().getParameterTypes();
            boolean correct = true;
            for (Class<?> j : params) {
              if (j.isArray()) {
                j = j.getComponentType();
              }
              if (storage.getClassInfo(j).getAnnotation(AvpDscr.class) == null) {
                correct = false;
                break;
              }
            }
            if (!correct) {
              continue;
            }
            // find max args constructor
            if (cacount < params.length) {
              cacount = params.length;
              cm = ci.getConstructor();
            }
          }
        }
        // fill cm args
        List<Object> initargs = new ArrayList<Object>();
        if (cm != null) {
          for (Class<?> ac : cm.getParameterTypes()) {
            Class<?> lac = ac.isArray() ? ac.getComponentType() : ac;
            cmargs.put(lac.getName(), ac);
            // Create params
            initargs.add(createChildByAvp(findChildDscr(cd.childs(), ac), ac, message.getAvps()));
          }
          // Create instance class
          rc = cm.newInstance(initargs.toArray());
        } else {
          rc = yourDomainMessageObject.newInstance();
        }
        //
        for (MethodInfo mi : c.getMethodsInfo()) {
          if (mi.getAnnotation(Setter.class) != null) {
            Class<?>[] pt = mi.getMethod().getParameterTypes();
            if (pt.length == 1 && storage.getClassInfo(pt[0]).getAnnotation(AvpDscr.class) != null) {
              Class<?> ptc = pt[0].isArray() ? pt[0].getComponentType() : pt[0];
              if (!cmargs.containsKey(ptc.getName())) {
                cmargs.put(ptc.getName(), ptc);
                mi.getMethod().invoke(rc, createChildByAvp(findChildDscr(cd.childs(), pt[0]), pt[0], message.getAvps()));
              }
            }
          }
        }
        // Fill undefined avp
        setUndefinedAvp(message.getAvps(), rc, c, cmargs);
      } catch (InstantiationException e) {
        throw new RecoderException(e);
      } catch (InvocationTargetException e) {
        throw new RecoderException(e);
      } catch (IllegalAccessException e) {
        throw new RecoderException(e);
      }
    }
    return (T) rc;
  }
910783
public static String format(String message, Object... formatArgs)
  {
    return String.format(Locale.ENGLISH, message, formatArgs);
  }