示例#1
0
  protected Advisory evaluateVital(Vital vital) {

    Advisory a = null;

    if (vital.isNoValueWarning() && vital.isEmpty()) {
      a = new Advisory(State.Warning, vital, null, "no source of");
    } else {
      for (Value val : vital) {
        if (val.isAtOrBelowLow()) {
          a =
              new Advisory(
                  val.isAtOrBelowCriticalLow() ? State.Alarm : State.Warning,
                  vital,
                  val.getValue(),
                  "low");
        }
        if (val.isAtOrAboveHigh()) {
          a =
              new Advisory(
                  val.isAtOrAboveCriticalHigh() ? State.Alarm : State.Warning,
                  vital,
                  val.getValue(),
                  "high");
        }
        if (a != null && a.state == State.Alarm) break;
      }
    }
    return a;
  }
示例#2
0
文件: Value.java 项目: ellert/JGlobus
 public boolean equals(Object obj) {
   if (obj instanceof Value) {
     Value src = (Value) obj;
     if (src.getValue() == null) {
       if (getValue() != null) return false;
     } else {
       if (!src.getValue().equals(getValue())) return false;
     }
     if (src.getConcat() == null) {
       if (getConcat() != null) return false;
     } else {
       if (!src.getConcat().equals(getConcat())) return false;
     }
     return true;
   } else {
     return super.equals(obj);
   }
 }