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(); }
public void setOriginalExpansionSetCode(String originalExpansionSetCode) { this.originalExpansionSetCode = originalExpansionSetCode; setTokenDescriptor(); }