Exemplo n.º 1
0
  public static String getObjectAsString(JEVisObject jevisObject, JEVisType jevisType)
      throws JEVisException {
    if (DatabaseHelper.checkValidStringObject(jevisObject, jevisType)) {
      return jevisObject.getAttribute(jevisType).getLatestSample().getValueAsString();

    } else {
      return null;
    }
  }
Exemplo n.º 2
0
 public static DateTime getObjectAsDate(
     JEVisObject jevisObject, JEVisType jevisType, DateTimeFormatter timeFormat)
     throws JEVisException {
   DateTime datetime = null;
   try {
     if (DatabaseHelper.checkValidStringObject(jevisObject, jevisType)) {
       String value = jevisObject.getAttribute(jevisType).getLatestSample().getValueAsString();
       datetime = timeFormat.parseDateTime(value);
     }
   } catch (NumberFormatException | JEVisException nfe) {
   }
   return datetime;
 }