Beispiel #1
0
 public void setExpansionSetCodeForImage(String code) {
   if (availableImageSetCodes.size() > 0) {
     if (availableImageSetCodes.contains(code)) {
       setOriginalExpansionSetCode(code);
     } else {
       // we should not set random set if appropriate set is already used
       if (getOriginalExpansionSetCode() == null
           || getOriginalExpansionSetCode().isEmpty()
           || !availableImageSetCodes.contains(getOriginalExpansionSetCode())) {
         setOriginalExpansionSetCode(
             availableImageSetCodes.get(RandomUtil.nextInt(availableImageSetCodes.size())));
       }
     }
   } else {
     if (getOriginalExpansionSetCode() == null || getOriginalExpansionSetCode().isEmpty()) {
       setOriginalExpansionSetCode(code);
     }
   }
   setTokenDescriptor();
 }
Beispiel #2
0
 public void setOriginalExpansionSetCode(String originalExpansionSetCode) {
   this.originalExpansionSetCode = originalExpansionSetCode;
   setTokenDescriptor();
 }