예제 #1
0
 public static Boolean getObjectAsBoolean(JEVisObject jevisObject, JEVisType jevisType)
     throws JEVisException {
   if (DatabaseHelper.checkValidBooleanObject(jevisObject, jevisType)) {
     return jevisObject.getAttribute(jevisType).getLatestSample().getValueAsBoolean();
   } else {
     return false;
   }
 }
예제 #2
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;
    }
  }
예제 #3
0
 public static Integer getObjectAsInteger(JEVisObject jevisObject, JEVisType jevisType) {
   Integer value = null;
   try {
     if (DatabaseHelper.checkValidNumberObject(jevisObject, jevisType)) {
       value = jevisObject.getAttribute(jevisType).getLatestSample().getValueAsLong().intValue();
     }
   } catch (NumberFormatException | JEVisException nfe) {
   }
   return value;
 }
예제 #4
0
 public static JEVisSelection getObjectAsSelection(JEVisObject jevisObject, JEVisType jevisType)
     throws JEVisException {
   JEVisSelection value = null;
   try {
     if (DatabaseHelper.checkValidSelectionObject(jevisObject, jevisType)) {
       value = jevisObject.getAttribute(jevisType).getLatestSample().getValueAsSelection();
     }
   } catch (NumberFormatException | JEVisException nfe) {
   }
   return value;
 }
예제 #5
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;
 }