public static boolean checkMessageFormat(PCEPMessage message) {
    PCEPCommonMessageHeader messageHeader = message.getMessageHeader();
    LinkedList<PCEPObjectFrame> objectsList = message.getObjectsList();

    int messageType = messageHeader.getTypeDecimalValue();

    switch (messageType) {
      case 0:
        { // UNDEFIND MSG
          return false;
        }

      case 1:
        {
          if (objectsList.size() > 1) {
            return false;
          }

          PCEPCommonObjectHeader objectHeader = objectsList.get(0).getObjectHeader();

          if (objectHeader.getClassDecimalValue() != 1 || objectHeader.getTypeDecimalValue() != 1) {
            return false;
          }

          return true; // TODO
        }

      case 2:
        { // KEEPALIVE MSG
          return true; // TODO
        }
      case 3:
        { // PATH COMPUTATION REQUEST MSG
          return true; // TODO
        }
      case 4:
        { // PATH COMPUTATION REPLY MSG
          return true; // TODO
        }
      case 5:
        { // NOTIFICATION MSG
          return true; // TODO
        }
      case 6:
        { // ERROR MSG
          return true; // TODO
        }
      case 7:
        { // CLOSE MSG
          return true; // TODO
        }
      default:
        { // UNDEFIND MSG
          return true;
        }
    }
  }
  public String toString() {
    String messageHeaderInfo = messageHeader.toString();
    StringBuffer objectFrameBuffer = new StringBuffer();

    for (short i = 0; i < objectsList.size(); i++) {
      objectFrameBuffer.append(objectsList.get(i).toString());
    }

    return messageHeaderInfo + objectFrameBuffer.toString();
  }
  public String binaryInformation() {
    String messageHeaderInfo = messageHeader.binaryInformation();
    StringBuffer objectFrameBuffer = new StringBuffer();

    for (short i = 0; i < objectsList.size(); i++) {
      String msg = objectsList.get(i).binaryInformation();
      objectFrameBuffer.append(msg);
    }

    return messageHeaderInfo + objectFrameBuffer.toString();
  }
  public String getMessageString() {

    StringBuffer messageStringBuffer = new StringBuffer();
    messageStringBuffer.append(messageHeader.getHeaderBinaryString());

    for (short i = 0; i < objectsList.size(); i++) {

      String currentHeaderString = objectsList.get(i).getObjectHeader().getHeaderBinaryString();
      String currentObjectString = objectsList.get(i).getObjectBinaryString();
      messageStringBuffer.append(currentHeaderString + currentObjectString);
    }

    String outputString = messageStringBuffer.toString();

    return outputString;
  }