Examples of withWarning()


Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

      EvaluationResult r = this.ops.get(0).evaluate(record);
      if (r.getPayload() instanceof String) {         
        return new EvaluationResult(
            new User((String) r.getPayload(), SharedConstants.User.DEFAULT_AUTH_DOMAIN), r);
      } else {
        return r.withWarning(ErrorCode.W121);
      }
    } else if (this.ops.size() == 2) {
      EvaluationResult r0 = this.ops.get(0).evaluate(record);
      EvaluationResult r1 = this.ops.get(1).evaluate(record);
      if (r0.getPayload() instanceof String && r1.getPayload() instanceof String) {
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

      if (r0.getPayload() instanceof String && r1.getPayload() instanceof String) {
        String email = (String)r0.getPayload();
        String authDomain = (String)r1.getPayload();
        return new EvaluationResult(new User(email, authDomain), r0, r1);
      } else {
        return r1.withWarning(ErrorCode.W121);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W120);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

       
        try {
          return new EvaluationResult(new GeoPt(lat, lon), r0, r1)
        } catch (IllegalArgumentException e) {
          // Longitude must be between -180 and 180 and Latitude must be between -90 and 90 (inclusive).
          return r1.withWarning(ErrorCode.W143);
        }
      } else {
        return r1.withWarning(ErrorCode.W123);
      }
    } else {
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

        } catch (IllegalArgumentException e) {
          // Longitude must be between -180 and 180 and Latitude must be between -90 and 90 (inclusive).
          return r1.withWarning(ErrorCode.W143);
        }
      } else {
        return r1.withWarning(ErrorCode.W123);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W122);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

   
    if (r.getPayload() instanceof String) {
      PhoneNumber val = new PhoneNumber((String) r.getPayload());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W133);
    }
  }
}
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

    } else if (r.getPayload() instanceof BigDecimal) {
      BigDecimal bd = (BigDecimal) r.getPayload();
      int index = bd.intValue() - 1;
      return new EvaluationResult(new TextFileRefWrapper(record.lookupFileReference(index)));
    } else {
      return r.withWarning(ErrorCode.W132);
    }
  }
}
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

   
    if (r.getPayload() instanceof String) {
      Email val = new Email((String) r.getPayload());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W136);
    }
  }
}
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

   
    if (r.getPayload() instanceof Number) {
      Number val = (Number) r.getPayload();
      return new EvaluationResult(val.doubleValue(), r)
    } else {
      return r.withWarning(ErrorCode.W139);
    }
  }
}
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

    } else if (this.ops.size() == 1) {
      EvaluationResult r = ops.get(0).evaluate(record);
      if (r.getPayload() instanceof String) {
        return new EvaluationResult(((String)r.getPayload()).toUpperCase(), r);
      } else {
        return r.withWarning(ErrorCode.W103);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W101);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult.withWarning()

      if (r.getPayload() instanceof String) {
        try {
          return new EvaluationResult(
              KeyFactory.stringToKey((String) r.getPayload()), r)
        } catch (IllegalArgumentException e) {  // invalid input key string
          return r.withWarning(ErrorCode.W129);
        }
      } else {
        return r.withWarning(ErrorCode.W125);
      }
    } else if (this.ops.size() % 2 == 0) { //TODO KEY('kind', 'name'/ID [, 'kind', 'name'/ID...])
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.