Calculates the check character for a given message

@param sMsg
the message
@param nLength
The number of characters to be checked. Must be &ge; 0 and &lt;
message.length
@return char the check character
962242
protected static char calcChecksumChar (@Nonnull final String sMsg, @Nonnegative final int nLength)
  {
    ValueEnforcer.notNull (sMsg, "Msg");
    ValueEnforcer.isBetweenInclusive (nLength, "Length", 0, sMsg.length ());

    return asChar (calcChecksum (sMsg.toCharArray (), nLength));
  }
877629
public static <T extends CharSequence> T validateChinese(T value, String errorMsg) throws ValidateException {
		if (false == isChinese(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
1115872
public QRSCT text(String text) {
		if (text != null && text.length() <= 140) {
			this.reference = ""; //$NON-NLS-1$
			this.text = checkValidSigns(text);
			return this;
		}
		throw new IllegalArgumentException("supplied text [" + text //$NON-NLS-1$
				+ "] not valid: has to be not null and of max length 140"); //$NON-NLS-1$
	}
304749
public static GroupCommunicationMessage getGCM(final Message<GroupCommunicationMessage> msg) {
    final Iterator<GroupCommunicationMessage> gcmIterator = msg.getData().iterator();
    if (gcmIterator.hasNext()) {
      final GroupCommunicationMessage gcm = gcmIterator.next();
      if (gcmIterator.hasNext()) {
        throw new RuntimeException("Expecting exactly one GCM object inside Message but found more");
      }
      return gcm;
    } else {
      throw new RuntimeException("Expecting exactly one GCM object inside Message but found none");
    }
  }
1138544
public T orElseThrow(final String msg) {
        checkNonEmptyString(msg, "Valid message required");
        if (isPresent()) {
            return get();
        }

        throw new NoSuchElementException(msg);
    }
190993
public void setText(CharSequence s) {
        if (mView == null) {
            throw new RuntimeException("This AppMsg was not created with AppMsg.makeText()");
        }
        TextView tv = (TextView) mView.findViewById(android.R.id.message);
        if (tv == null) {
            throw new RuntimeException("This AppMsg was not created with AppMsg.makeText()");
        }
        tv.setText(s);
    }
693147
@Override
    protected final char nextChar() {
        if (currentChar != 0) {
            char ch = currentChar;
            this.currentChar = 0;
            return ch;
        }
        if (this.currentBuffer != null) {
            int remain = this.currentBuffer.remaining();
            if (remain == 0 && this.currentIndex + 1 >= this.buffers.length) return 0;
        }
        byte b1 = nextByte();
        if (b1 >= 0) {// 1 byte, 7 bits: 0xxxxxxx
            return (char) b1;
        } else if ((b1 >> 5) == -2 && (b1 & 0x1e) != 0) { // 2 bytes, 11 bits: 110xxxxx 10xxxxxx
            return (char) (((b1 << 6) ^ nextByte()) ^ (((byte) 0xC0 << 6) ^ ((byte) 0x80)));
        } else if ((b1 >> 4) == -2) { // 3 bytes, 16 bits: 1110xxxx 10xxxxxx 10xxxxxx
            return (char) ((b1 << 12) ^ (nextByte() << 6) ^ (nextByte() ^ (((byte) 0xE0 << 12) ^ ((byte) 0x80 << 6) ^ ((byte) 0x80))));
        } else { // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
            throw new RuntimeException(new UnmappableCharacterException(4));
        }
    }
1100557
def check_multiplication_symbol(text):
    """
    err = "typography.symbols.multiplication_symbol"
    msg = u"Use the multiplication symbol ×, not the letter x."
    regex = "[0-9]+ ?x ?[0-9]+"

    return existence_check(
        text, [regex], err, msg, max_errors=3, require_padding=False)
622393
private static int _checkInlineEntity (final StringBuilder aOut, final String sIn, final int nStart)
  {
    final int nPos = MarkdownHelper.readUntil (aOut, sIn, nStart, ';');
    if (nPos < 0 || aOut.length () < 3)
      return -1;
    if (aOut.charAt (1) == '#')
    {
      if (aOut.charAt (2) == 'x' || aOut.charAt (2) == 'X')
      {
        if (aOut.length () < 4)
          return -1;
        for (int i = 3; i < aOut.length (); i++)
        {
          final char c = aOut.charAt (i);
          if ((c < '0' || c > '9') && ((c < 'a' || c > 'f') && (c < 'A' || c > 'F')))
            return -1;
        }
      }
      else
      {
        for (int i = 2; i < aOut.length (); i++)
        {
          final char c = aOut.charAt (i);
          if (c < '0' || c > '9')
            return -1;
        }
      }
      aOut.append (';');
    }
    else
    {
      for (int i = 1; i < aOut.length (); i++)
      {
        final char c = aOut.charAt (i);
        if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z'))
          return -1;
      }
      aOut.append (';');
      return EHTMLEntity.isValidEntityReference (aOut.toString ()) ? nPos : -1;
    }

    return nPos;
  }
1298977
private boolean isValidMsgName(Node nameNode) {
    if (nameNode.isName() || nameNode.isStringKey()) {
      return nameNode.getString().startsWith("MSG_");
    } else if (nameNode.isQualifiedName()) {
      return nameNode.getLastChild().getString().startsWith("MSG_");
    } else {
      return false;
    }
  }
453629
public static void isFalse (@Nonnull final BooleanSupplier aValue, final String sMsg)
  {
    if (isEnabled ())
      isFalse (aValue, () -> sMsg);
  }
195104
public static Validation<Integer> greaterThan(int min, String msg) {
        return SimpleValidation.from((i) -> i > min, format(msg, min));
    }
1117254
public static boolean isValidNmtoken(String nmtoken) {
    final int length = nmtoken.length();
    if (length == 0) {
      return false;
    }
    for (int i = 0; i < length; ++i) {
      char ch = nmtoken.charAt(i);
      if (!isName(ch)) {
        return false;
      }
    }
    return true;
  }
978655
public static void log (@Nonnull final Logger aLogger,
                          @Nonnull final IHasErrorLevel aErrorLevelProvider,
                          @Nonnull final String sMsg)
  {
    log (aLogger, aErrorLevelProvider.getErrorLevel (), sMsg, null);
  }
1100595
public static <T> Validation<T> notNull(String msg) {
        return SimpleValidation.from(Objects::nonNull, msg);
    }
1195972
public static <T extends CharSequence> T validateLowerCase(T value, String errorMsg) throws ValidateException {
		if (false == isLowerCase(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
199397
private static boolean charReg(char charValue) {
		return (charValue >= 0x4E00 && charValue <= 0XFFF) || //
				(charValue >= 'a' && charValue <= 'z') || //
				(charValue >= 'A' && charValue <= 'Z') || //
				(charValue >= '0' && charValue <= '9');
	}