检查AndroidMessage对象是否合法
@param  {[type]}  message 待检查的message对象
@return {Boolean}         检查结果
496087
function isAndroidMessageValid(message){

	if(!(message instanceof AndroidMessage)){
		throw new Error('message is invalid');
	}

	if(typeof message.content !== 'string' || message.content.trim().length === 0){
		throw new Error('content is invalid');
	}

	if(message.type !== exports.MESSAGE_TYPE_NOTIFICATION && message.type !== exports.MESSAGE_TYPE_MESSAGE){
		throw new Error('type is invalid');
	}

	if(parseInt(message.expireTime) !== message.expireTime || message.expireTime < 0 || message.expireTime > 60*60*24*3){
		throw new Error('expireTime is invalid');
	}

	if(parseInt(message.sendTime) !== message.sendTime || message.sendTime < 0){
		throw new Error('sendTime is invalid');
	}

	if(!isAndroidCustomContentValid(message.customContent)){
		throw new Error('customContent is invalid');
	}

	if(!isAccessTimeValid(message.acceptTime)){
		throw new Error('acceptTime is invalid');
	}

    if(message.multiPkg !== 0 && message.multiPkg !== 1){
        throw new Error('multiPkg is invalid');
    }

    if(message.loopTimes !== null && parseInt(message.loopTimes) != message.loopTimes){
        throw new Error('loopTimes is invalid');
    }

    if(message.loopInterval !== null && parseInt(message.loopInterval) != message.loopInterval){
        throw new Error('loopInterval is invalid');
    }

	if(message.type === exports.MESSAGE_TYPE_NOTIFICATION){
		
		//效验通知合法性
		
		if(typeof message.title !== 'string' || message.title.trim().length === 0){
			throw new Error('title is invalid');
		}

        isStyleValid(message.style);

        isActionValid(message.action);

	}else{

		//效验消息合法性
		if(typeof message.title !== 'string'){
			throw new Error('title is invalid');
		}		
	}

	return true;
}
1356299
public static String getMessageJson(Object message) {
        VersionedMessage<?> versionedMessage = new VersionedMessage<>(CURRENT_MESSAGE_VERSION, message);

        return GSON.toJson(versionedMessage);
    }
31871
function checkMsg(msg, protos) {
    if (!protos || !msg) {
        console.warn('no protos or msg exist! msg : %j, protos : %j', msg, protos);
        return false;
    }

    for (const name in protos) {
        if (protos.hasOwnProperty(name)) {
            let message;
            const proto = protos[name];

            // All required element must exist
            switch (proto.option) {
            case 'required' :
                if (typeof (msg[name]) === 'undefined') {
                    console.warn('no property exist for required! name: %j, proto: %j, msg: %j', name, proto, msg);
                    return false;
                }
            case 'optional' :    // eslint-disable-line
                if (typeof (msg[name]) !== 'undefined') {
                    message = protos.__messages[proto.type] || Encoder.protos[`message ${proto.type}`];
                    if (!!message && !checkMsg(msg[name], message)) {
                        console.warn('inner proto error! name: %j, proto: %j, msg: %j', name, proto, msg);
                        return false;
                    }
                }
                break;
            case 'repeated' :
                // Check nest message in repeated elements
                message = protos.__messages[proto.type] || Encoder.protos[`message ${proto.type}`];
                if (!!msg[name] && !!message) {
                    for (let i = 0; i < msg[name].length; i++) {
                        if (!checkMsg(msg[name][i], message)) {
                            return false;
                        }
                    }
                }
                break;
            default:
                break;
            }
        }
    }

    return true;
}
34262
function logMessage (message, data) {
  if (!message) return
  render(message, data, (err, res) => {
    if (err) {
      console.error('\n   Error when rendering template complete message: ' + err.message.trim())
    }
    else {
      console.log('\n' + res.split(/\r?\n/g).map(line => '   ' + line).join('\n'))
    }
  })
}
983992
public void setMessage(String message) {
        requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty.");
        this.message = message;
    }
243774
public String checkMessagingConnectionForTheDm( String message )
	throws DebugWsException {

		this.logger.finer( "Checking messaging connection with the DM: message=" + message );

		WebResource path = this.resource.path( UrlConstants.DEBUG ).path( "check-dm" );
		if( message != null )
			path = path.queryParam( "message", message );

		ClientResponse response = this.wsClient.createBuilder( path ).get( ClientResponse.class );
		if( Family.SUCCESSFUL != response.getStatusInfo().getFamily()) {
			String value = response.getEntity( String.class );
			this.logger.finer( response.getStatusInfo() + ": " + value );
			throw new DebugWsException( response.getStatusInfo().getStatusCode(), value );
		}

		this.logger.finer( String.valueOf( response.getStatusInfo()));
		return response.getEntity( String.class );
	}
656672
public static boolean isXHTMLMessage(Message message) {
        return message.getExtension(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE) != null;
    }
1236009
public boolean isApiMessage() {
        MessageType mType = getJsMessageType();
        return (mType == MessageType.JMS || mType == MessageType.SDO);
    }
598151
function isErrorMessage(message) {
	const level = message.fatal ? 2 : message.severity;

	if (Array.isArray(level)) {
		return level[0] > 1;
	}

	return level > 1;
}
510315
function(message) {
        if (!this._tickList) {
            this._tickList = [];
            while (this._tickList.length < this._maxTicks) {
                this._tickList.push(0);
            }
        }

        if (!this._lastHeart) {
            this._lastHeart = Date.now();
            this._lastFpsUpdate = this._lastHeart;
            return;
        }

        var newHeart = Date.now();
        var newTick = newHeart - this._lastHeart;
        this._lastHeart = newHeart;

        this._tickSum -= this._tickList[this._tickIndex];
        this._tickSum += newTick;
        this._tickList[this._tickIndex] = newTick;
        if (++this._tickIndex == this._maxTicks) {
            this._tickIndex = 0;
        }
    }
977197
@Override
    public void onMessage(String channel, String message) {
        LoglevelCommand loglevelCommand = Json.fromJson(LoglevelCommand.class, message);
        //通过实例名称更改日志等级 或 通过进程ID更改日志等级
        if (("name".equals(loglevelCommand.getAction())
                && Strings.sNull(loglevelCommand.getName()).equals(loglevelProperty.getName())) ||
                ("processId".equals(loglevelCommand.getAction()) && Strings.sNull(loglevelCommand.getProcessId()).equals(loglevelProperty.getProcessId()))) {
            //更改之前
            System.out.println("logback loglevel change start.");
            testLevel();
            if (Strings.isNotBlank(loglevelCommand.getLevel())) {
                setLevel(loglevelCommand.getLevel());
                saveToRedis();
            }
            System.out.println("----------------------------");
            //更改之后
            testLevel();
            System.out.println("logback loglevel change end.");
        }
    }
11421
@Override
    public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
        return activity.getActivityContext().getMessageSource().getMessage(code, args, defaultMessage, locale);
    }
828801
public void setMessage(CharSequence message){
        if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
            TextView msgView = (TextView) getDialog().findViewById(R.id.message);
            msgView.setText(message);
        }else{
            if(mMessage != null){
                mMessage.setText(message);
            }
        }
    }
603547
protected boolean checkSendMessageEnabled(RTMPMessage message) {
        IRTMPEvent body = message.getBody();
        if (!receiveAudio && body instanceof AudioData) {
            // The user doesn't want to get audio packets
            ((IStreamData<?>) body).getData().free();
            if (sendBlankAudio) {
                // Send reset audio packet
                sendBlankAudio = false;
                body = new AudioData();
                // We need a zero timestamp
                if (lastMessageTs >= 0) {
                    body.setTimestamp(lastMessageTs - timestampOffset);
                } else {
                    body.setTimestamp(-timestampOffset);
                }
                message = RTMPMessage.build(body);
            } else {
                return false;
            }
        } else if (!receiveVideo && body instanceof VideoData) {
            // The user doesn't want to get video packets
            ((IStreamData<?>) body).getData().free();
            return false;
        }
        return true;
    }
1036199
private ObjectJS jsonMessage(String message, StringifierFactory jsonStringifierFactory) {
		ObjectJS bucketsJS = new ObjectJS();
		bucketsJS.setSimpleAttribute("message", message, jsonStringifierFactory.getStringifier(String.class));
		return bucketsJS;
	}
1019443
function onMessage(message) {
    if (done) return
    if (message.type != "utf8") return sendConnectFailed(wsConn)

    try {
      message = JSON.parse(message.utf8Data)
    }
    catch(err) {
      return sendConnectFailed(wsConn)
    }

    var id  = message.id

    if (message.type != "request") return sendConnectFailed(wsConn)
    if (message.name != "connect") return sendConnectFailed(wsConn)
    if (message.to   != "server") return sendConnectFailed(wsConn)

    var body = message.body || {}

    if (!body.key) return sendConnectFailed(wsConn)

    var session = sessions.getSession(body.key)
    var channel = channels.createChannel(session, wsConn)

    message = {
      type: "response",
      name: "connect",
      from: "server",
      id:   message.id,
      body: null
    }

    wsConn.sendUTF(JSON.stringify(message))
    cleanUp()
  }
1314941
function(message) {
      var key = "";
      if (message) {
        var x = message.level &&
        (key += message.level, message.kind &&
          (key += this.delimiter + message.kind, message.rule &&
            (key += this.delimiter + message.rule, message.values.title &&
              (key += this.delimiter + message.values.title))));
            }
            return (key) ? key : "";
          }