code: public final void asString(final Format format, final StructuredDataId structuredDataId, final StringBuilder sb) {
          final boolean full = Format.FULL.equals(format);
          if (full) {
              final String myType = getType();
              if (myType == null) {
                  return;
              }
              sb.append(getType()).append(' ');
          }
          StructuredDataId sdId = getId();
          if (sdId != null) {
              sdId = sdId.makeId(structuredDataId); // returns sdId if structuredDataId is null
          } else {
              sdId = structuredDataId;
          }
          if (sdId == null || sdId.getName() == null) {
              return;
          }
          sb.append('[');
          StringBuilders.appendValue(sb, sdId); // avoids toString if implements StringBuilderFormattable
          sb.append(' ');
          appendMap(sb);
          sb.append(']');
          if (full) {
              final String msg = getFormat();
              if (msg != null) {
                  sb.append(' ').append(msg);
              }
          }
      }
docs: Formats the structured data as described in RFC 5424.
  
  @param format           "full" will include the type and message. null will return only the STRUCTURED-DATA as
  described in RFC 5424
  @param structuredDataId The SD-ID as described in RFC 5424. If null the value in the StructuredData
  will be used.
  @param sb The StringBuilder to append the formatted message to.