private int validAndGetTimeValue(JsonObject ruleObject, String fieldName,
            int itemNo, int recordNo) throws Exception {
        if (!ruleObject.has(fieldName)) {
            throw new Exception(new StringBuilder(512)
                    .append("FIELD ").append(fieldName).append(" is required ")
                    .append("in data_limit item(").append(itemNo)
                    .append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        String strTimeVal = ruleObject.get(fieldName).getAsString();
        if (TStringUtils.isBlank(strTimeVal)) {
            throw new Exception(new StringBuilder(512)
                    .append("the value of FIELD ").append(fieldName)
                    .append(" is null or blank in data_limit item(").append(itemNo)
                    .append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        int timeHour = 0;
        int timeMin = 0;
        String[] startItems = strTimeVal.split(TokenConstants.ATTR_SEP);
        if ((startItems.length != 2)
                || TStringUtils.isBlank(startItems[0])
                || TStringUtils.isBlank(startItems[1])) {
            throw new Exception(new StringBuilder(512)
                    .append("illegal format, the value of FIELD ").append(fieldName)
                    .append(" must be 'aa:bb' and 'aa','bb' must be int value ")
                    .append("in data_limit item(").append(itemNo)
                    .append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        try {
            timeHour = Integer.parseInt(startItems[0]);
        } catch (Throwable e2) {
            throw new Exception(new StringBuilder(512)
                    .append("illegal format, the value of FIELD ").append(fieldName)
                    .append(" must be 'aa:bb' and 'aa' must be int value ")
                    .append("in data_limit item(").append(itemNo)
                    .append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        try {
            timeMin = Integer.parseInt(startItems[1]);
        } catch (Throwable e2) {
            throw new Exception(new StringBuilder(512)
                    .append("illegal format, the value of FIELD ").append(fieldName)
                    .append(" must be 'aa:bb' and 'bb' must be int value ")
                    .append("in data_limit item(").append(itemNo)
                    .append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        if (timeHour < 0 || timeHour > 24) {
            throw new Exception(new StringBuilder(512)
                    .append("illegal value, the value of FIELD ").append(fieldName)
                    .append("-hour value must in [0,23] in data_limit item(")
                    .append(itemNo).append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        if (timeMin < 0 || timeMin > 59) {
            throw new Exception(new StringBuilder(512)
                    .append("illegal value, the value of FIELD ").append(fieldName)
                    .append("-minute value must in [0,59] in data_limit item(")
                    .append(itemNo).append(").record(").append(recordNo)
                    .append(") of flowCtrlInfo value!").toString());
        }
        return timeHour * 100 + timeMin;
    }
Parse time information

@param ruleObject   rule value object
@param fieldName     field name
@param itemNo        rule no
@param recordNo      record no
@return              parse result
@throws Exception    Exception thrown
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corebase/policies/FlowCtrlRuleHandler.java