Forces the use of the specified MicroPDF417 variant. Only valid
when using {@link Mode#MICRO micro} mode.

@param variant the MicroPDF417 variant to use
328786
public void setVariant(int variant) {
        if (symbolMode != Mode.MICRO) {
            throw new IllegalArgumentException("Can only set variant when using MICRO mode.");
        }
        if (variant < 1 || variant > 34) {
            throw new IllegalArgumentException("Variant must be between 1 and 34.");
        }
        this.columns = MICRO_VARIANTS[variant - 1];
        this.rows = MICRO_VARIANTS[variant - 1 + 34];
    }
981823
public function participate($test, $variant)
    {
        $test = $test instanceof TestInterface ? $test->getIdentifier() : $test;
        $variant = $variant instanceof VariantInterface ? $variant->getIdentifier() : $variant;

        $this->storage->set($test, $variant);
    }
267897
private void registerSTV(String source,
                             String target,
                             String variant) {
        // assert(source.length() > 0);
        // assert(target.length() > 0);
        CaseInsensitiveString cisrc = new CaseInsensitiveString(source);
        CaseInsensitiveString citrg = new CaseInsensitiveString(target);
        CaseInsensitiveString civar = new CaseInsensitiveString(variant);
        Map<CaseInsensitiveString, List<CaseInsensitiveString>> targets = specDAG.get(cisrc);
        if (targets == null) {
            targets = Collections.synchronizedMap(new HashMap<CaseInsensitiveString, List<CaseInsensitiveString>>());
            specDAG.put(cisrc, targets);
        }
        List<CaseInsensitiveString> variants = targets.get(citrg);
        if (variants == null) {
            variants = new ArrayList<CaseInsensitiveString>();
            targets.put(citrg, variants);
        }
        // assert(NO_VARIANT == "");
        // We add the variant string.  If it is the special "no variant"
        // string, that is, the empty string, we add it at position zero.
        if (!variants.contains(civar)) {
            if (variant.length() > 0) {
                variants.add(civar);
            } else {
                variants.add(0, civar);
            }
        }
    }
855591
public void addVariantDatasetMetadata(VariantStudyMetadata variantStudyMetadata) {
        if (variantStudyMetadata != null) {
            VariantStudyMetadata found = getVariantStudyMetadata(variantStudyMetadata.getId());
            // if there is not any study with that ID then we add the new one
            // TODO we need to think what to do when it exists, should we throw an exception?
            if (found == null) {
                if (variantMetadata.getStudies() == null) {
                    variantMetadata.setStudies(new ArrayList<>());
                }
                variantMetadata.getStudies().add(variantStudyMetadata);
            } else {
                logger.error("Study ID already exists");
            }
        }
    }
1068182
public function addVariant(VariantInterface $variant)
    {
        if (!$this->hasVariant($variant)) {
            $variant->setObject($this);
            $this->variants->add($variant);
        }

        return $this;
    }
844078
public function removeVariant(VariantInterface $variant)
    {
        if ($this->hasVariant($variant)) {
            $variant->setObject(null);
            $this->variants->removeElement($variant);
        }

        return $this;
    }
966647
public void setVersion(String version) {

        m_number = 0L;
        if ((version == null) || (version.charAt(0) == '.') || (version.charAt(version.length() - 1) == '.')) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_NOT_NUMBER_0));
        }
        String[] split = CmsStringUtil.splitAsArray(version, '.');
        m_dots = split.length;
        if (m_dots > 4) {
            throw new CmsIllegalArgumentException(
                Messages.get().container(Messages.ERR_INVALID_VERSION_LENGTH_1, version));
        }
        String[] numbers = new String[5];
        System.arraycopy(split, 0, numbers, 1, m_dots);
        numbers[0] = "1";
        for (int i = 1 + m_dots; i < 5; i++) {
            numbers[i] = "0";
        }
        for (int i = numbers.length - 1; i >= 0; i--) {
            try {
                int number = Integer.valueOf(numbers[numbers.length - i - 1]).intValue();

                if ((number > 999) || (number < 0)) {
                    throw new CmsIllegalArgumentException(
                        Messages.get().container(Messages.ERR_INVALID_VERSION_SUBNUMBER_1, new Integer(number)));
                }
                m_number = ((long)Math.pow(1000.0, i) * number) + m_number;
            } catch (NumberFormatException e) {
                // no valid version provided
                throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_NOT_NUMBER_0));
            }
        }

        setVersion(m_number);
    }
183791
public String getVariant(String variantType) {
		String variant = null;
		if (bundleVariants != null) {
			variant = (String) bundleVariants.get(variantType);
		}
		return variant;
	}
1094264
public boolean requestShouldBeHandledByTAI(HttpServletRequest request, MicroProfileJwtTaiRequest mpJwtTaiRequest, boolean defaultConfig) {
        String methodName = "requestShouldBeHandledByTAI";
        if (tc.isDebugEnabled()) {
            Tr.entry(tc, methodName, request, mpJwtTaiRequest);
        }

        mpJwtTaiRequest = setTaiRequestConfigInfo(request, mpJwtTaiRequest, defaultConfig);
        boolean result = false;
        boolean ignoreAppAuthMethod = true;

        MicroProfileJwtConfig mpJwtConfig = null;
        try {
            mpJwtConfig = mpJwtTaiRequest.getOnlyMatchingConfig();
        } catch (MpJwtProcessingException e) {

        }
        if (mpJwtConfig != null) {
            if (shouldDeferToJwtSso(request, mpJwtConfig, mpJwtTaiRequest.getJwtSsoConfig())) {
                return false;
            }
            ignoreAppAuthMethod = mpJwtConfig.ignoreApplicationAuthMethod(); // true by default
            if (ignoreAppAuthMethod) {
                result = mpJwtTaiRequest.hasServices();
            } else {
                result = isMpJwtSpecifiedInLoginConfig(request);
            }
        }

        if (tc.isDebugEnabled()) {
            Tr.exit(tc, methodName, result);
        }
        return result;
    }
29404
public Map<String, String> getAvailableVariantMap(Map<String, VariantSet> variants,
			Map<String, String> curVariants) {

		Map<String, String> availableVariantMap = new HashMap<>();
		for (Entry<String, VariantSet> entry : variants.entrySet()) {
			String variantType = entry.getKey();
			VariantSet variantSet = entry.getValue();
			String variant = variantSet.getDefaultVariant();
			if (curVariants.containsKey(variantType)) {
				String curVariant = curVariants.get(variantType);
				VariantResolver resolver = variantResolvers.get(variantType);
				if (resolver != null) {
					variant = resolver.getAvailableVariant(curVariant, variants.get(variantType));
					if (variant == null) {
						variant = variants.get(variantType).getDefaultVariant();
					}
				} else {
					throw new BundlingProcessException(
							"Unable to find variant resolver for variant type '" + variantType + "'");
				}
			}
			availableVariantMap.put(variantType, variant);
		}
		return availableVariantMap;
	}
1218451
private function mapDataToVariant(ProductInterface $variant, array $variantData, $locale, $userId)
    {
        $productTranslation = $this->productManager->retrieveOrCreateProductTranslationByLocale($variant, $locale);
        $productTranslation->setName($this->getProperty($variantData, 'name'));

        $variant->setNumber($this->getProperty($variantData, 'number'));

        $this->processAttributes($variant, $variantData, $locale);
        $this->processPrices($variant, $variantData);
    }
734000
public static Object toObject(COMObject parent, Variant variant, String key) throws ExpressionException {
	short type = variant.getvt();
	// print.ln(key+" -> variant.getvt("+toStringType(type)+")");

	/*
	 * TODO impl this Variant.VariantByref; Variant.VariantError; Variant.VariantTypeMask;
	 */

	if (type == Variant.VariantEmpty) return null;
	else if (type == Variant.VariantNull) return null;
	else if (type == Variant.VariantShort) return Short.valueOf(variant.getShort());
	else if (type == Variant.VariantInt) return Integer.valueOf(variant.getInt());
	else if (type == Variant.VariantFloat) return new Float(variant.getFloat());
	else if (type == Variant.VariantDouble) return new Double(variant.getDouble());
	else if (type == Variant.VariantCurrency) {
	    long l;
	    try {
		l = variant.getCurrency().longValue();
	    }
	    // this reflection allows support for old and new jacob version
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
		try {
		    Method toCurrency = variant.getClass().getMethod("toCurrency", new Class[0]);
		    Object curreny = toCurrency.invoke(variant, new Object[0]);

		    Method longValue = curreny.getClass().getMethod("longValue", new Class[0]);
		    l = Caster.toLongValue(longValue.invoke(curreny, new Object[0]), 0);
		}
		catch (Throwable t2) {
		    ExceptionUtil.rethrowIfNecessary(t2);
		    l = 0;
		}
	    }
	    return Long.valueOf(l);
	}
	else if (type == Variant.VariantObject) return variant.toEnumVariant();
	else if (type == Variant.VariantDate) return new DateTimeImpl((long) variant.getDate(), true);
	else if (type == Variant.VariantString) return variant.getString();
	else if (type == Variant.VariantBoolean) return variant.getBoolean() ? Boolean.TRUE : Boolean.FALSE;
	else if (type == Variant.VariantByte) return new Byte(variant.getByte());
	else if (type == Variant.VariantVariant) {
	    throw new ExpressionException("type variant is not supported");
	    // return toObject(variant.getV.get());
	}
	else if (type == Variant.VariantArray) {
	    Variant[] varr = variant.getVariantArrayRef();
	    Object[] oarr = new Object[varr.length];
	    for (int i = 0; i < varr.length; i++) {
		oarr[i] = toObject(parent, varr[i], Caster.toString(i));
	    }
	    return new ArrayImpl(oarr);
	}
	else if (type == Variant.VariantDispatch) {

	    return new COMObject(variant, variant.toDispatch(), parent.getName() + "." + key);
	}
	// TODO ?? else if(type==Variant.VariantError) return variant.toError();

	throw new ExpressionException("COM Type [" + toStringType(type) + "] not supported");
    }
1238668
public static String partialDeltemplateTemplateName(
      String delTemplateName, @Nullable String delPackageName, String variant) {
    String delPackageTemplateAndVariantStr =
        (delPackageName == null ? "" : delPackageName)
            + "_"
            + delTemplateName.replace('.', '_')
            + "_"
            + variant;
    delPackageTemplateAndVariantStr = delPackageTemplateAndVariantStr.replace('.', '_');
    // Generate the actual internal-use template name.
    return ".__deltemplate_" + delPackageTemplateAndVariantStr;
  }
156011
@Override
	public String getURLPrefix(Map<String, String> variants) {

		if (null == this.urlPrefix)
			throw new IllegalStateException("The bundleDataHashCode must be set before accessing the url prefix.");

		if (variants != null && !variants.isEmpty()) {
			String key = getAvailableVariant(variants);
			if (StringUtils.isNotEmpty(key)) {
				return prefixMap.get(key) + "." + key + "/";
			}
		}
		return this.urlPrefix + "/";
	}
108752
public function setMasterVariant(VariantInterface $masterVariant)
    {
        $masterVariant->setMaster(true);

        /** @var VariantInterface $variant */
        foreach ($this->variants as $variant) {
            if ($variant->isMaster() && $variant !== $masterVariant) {
                $variant->setMaster(false);
            }
        }

        if (!$this->variants->contains($masterVariant)) {
            $masterVariant->setObject($this);
            $this->variants->add($masterVariant);
        }

        return $this;
    }
567664
public function variantContentType($variant)
    {
        $variants = $this->variantsAttribute();

        if ( ! empty($variants)) {
            return Arr::get($variants, "{$variant}.type") ?: false;
        }

        if (false !== ($type = $this->config->variantMimeType($variant))) {
            return $type;
        }

        return $this->contentType();
    }
1340485
protected function extractPaperclipVariantInfo(PaperclipAttachmentInstance $paperclip, $variant)
    {
        $config = $paperclip->getNormalizedConfig();

        $variantSteps = array_get($config, "variants.{$variant}", []);

        $dimensions = array_get($variantSteps, 'resize.dimensions');
        $extension  = array_get($variantSteps, "extensions.{$variant}");
        $mimeType   = array_get($variantSteps, "types.{$variant}");

        return compact('dimensions', 'extension', 'mimeType');
    }