Пример #1
0
  @Override
  public void checkApiParams() throws CheckException {
    // group-1:mebId
    if (this.mebId != null) {
      if (this.mebId <= 0) throw new CheckIllicitValueException("field: mebId, value is illicit.");
    }
    // group-2:idStr
    else if (!MyStringUtils.isEmpty(this.idStr)) {
    }
    // exception
    else throw new CheckEmptyException("fields are empty.");

    this.idStr = this.idStr == null ? this.idStr : this.idStr.trim();
  }
  @Override
  public void checkApiParams() throws CheckException {
    if (MyStringUtils.isEmpty(this.name)) throw new CheckEmptyException("field: name is empty.");

    if (this.mebAssetTypeId == null || this.mebAssetTypeId <= 0)
      throw new CheckIllicitValueException("field: mebAssetTypeId is illicit.");

    if (this.faceValue == null || this.faceValue <= 0)
      throw new CheckIllicitValueException("field: faceValue is illicit.");

    if (this.validBeginDate == null)
      throw new CheckIllicitValueException("field: validBeginDate is illicit.");

    if (this.validEndDate == null)
      throw new CheckIllicitValueException("field: validEndDate is illicit.");

    if (this.validBeginDate.getTime() > this.validEndDate.getTime())
      throw new CheckIllicitValueException("validBeginDate should be larger than validEndDate.");
  }