Ejemplo n.º 1
0
 public DateId(String dateId) {
   super();
   if (!isValid(dateId)) {
     throw new InvalidParameterException(
         DateId.class.getSimpleName() + " must contain a valid date");
   }
   this.calendar = DateUtil.fromISO8601(dateId);
 }
Ejemplo n.º 2
0
 public static final boolean isValid(String dateId) {
   if (dateId == null) {
     return false;
   }
   try {
     DateUtil.fromISO8601(dateId);
     return true;
   } catch (Exception e) {
     return false;
   }
 }
Ejemplo n.º 3
0
 @Override
 public String getIdentifier() {
   return DateUtil.toISO8601(this.calendar);
 }