Returns the current variant for the variant type specified in parameter

@param variantType
the variant type
@return the current variant
183791
public String getVariant(String variantType) {
		String variant = null;
		if (bundleVariants != null) {
			variant = (String) bundleVariants.get(variantType);
		}
		return variant;
	}
62311
public void registerVariantResolver(VariantResolver resolver) {

		for (VariantResolver variantResolver : variantResolvers.values()) {
			if (StringUtils.isEmpty(resolver.getVariantType())) {
				throw new IllegalStateException(
						"The getVariantType() method must return something at " + resolver.getClass());
			}

			if (resolver.getVariantType().equals(variantResolver.getVariantType())) {
				throw new IllegalStateException("There are 2 resolvers defined for the variant type '"
						+ resolver.getVariantType() + "' : " + variantResolver.getClass() + ";" + resolver.getClass());
			}
		}
		variantResolvers.put(resolver.getVariantType(), resolver);
	}
796221
final public JSVariant Variant(Map refs) throws ParseException {
                                JSVariant ans = new JSVariant(); JSType mem;
    jj_consume_token(5);
    mem = TypeDecl(refs);
                             ans.addCase(mem);
    label_2:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 6:
        ;
        break;
      default:
        jj_la1[3] = jj_gen;
        break label_2;
      }
      jj_consume_token(6);
      mem = TypeDecl(refs);
                               ans.addCase(mem);
    }
    jj_consume_token(7);
                                                            {if (true) return ans;}
    throw new Error("Missing return statement in function");
  }
376365
@Override
    public String getVariant() {

        StringBuilder sb = new StringBuilder(64);
        sb.append("historic-");
        sb.append(this.variant.name());

        switch (this.variant){
            case PROLEPTIC_GREGORIAN:
            case PROLEPTIC_JULIAN:
            case PROLEPTIC_BYZANTINE:
                sb.append(":no-cutover");
                break;
            case INTRODUCTION_ON_1582_10_15:
            case SINGLE_CUTOVER_DATE:
                sb.append(":cutover=");
                sb.append(this.getGregorianCutOverDate());
                // fall-through
            default:
                sb.append(":ancient-julian-leap-years=");
                if (this.ajly != null) {
                    int[] pattern = this.ajly.getPattern();
                    sb.append('[');
                    sb.append(pattern[0]);
                    for (int i = 1; i < pattern.length; i++) {
                        sb.append(',');
                        sb.append(pattern[i]);
                    }
                    sb.append(']');
                } else {
                    sb.append("[]");
                }
                sb.append(":new-year-strategy=");
                sb.append(this.getNewYearStrategy());
                sb.append(":era-preference=");
                sb.append(this.getEraPreference());
        }

        return sb.toString();

    }
194053
def variant(self):
        ''''''
        variant = current_app.config['THEME_VARIANT']
        if variant not in self.variants:
            log.warning('Unkown theme variant: %s', variant)
            return 'default'
        else:
            return variant
254213
public Set<String> getGeneratedResourceVariantTypes(String path) {

		Set<String> variantTypes = new HashSet<>();
		ResourceGenerator generator = resolveResourceGenerator(path);
		if (generator != null) {
			if (generator instanceof VariantResourceGenerator) {

				Set<String> tempResult = ((VariantResourceGenerator) generator)
						.getAvailableVariants(generator.getResolver().getResourcePath(path)).keySet();
				if (tempResult != null) {
					variantTypes = tempResult;
				}
			} else if (generator instanceof LocaleAwareResourceGenerator) {
				variantTypes = new HashSet<>();
				variantTypes.add(JawrConstant.LOCALE_VARIANT_TYPE);
			}
		}

		return variantTypes;
	}
235728
public static String getVariantBundleName(String bundleName, String variantKey, boolean iGeneratedResource) {

		String newName = bundleName;
		if (StringUtils.isNotEmpty(variantKey)) {
			int idxSeparator = bundleName.lastIndexOf('.');
			if (!iGeneratedResource && idxSeparator != -1) {
				newName = bundleName.substring(0, idxSeparator);
				newName += JawrConstant.VARIANT_SEPARATOR_CHAR + variantKey;
				newName += bundleName.substring(idxSeparator);
			} else {
				newName += JawrConstant.VARIANT_SEPARATOR_CHAR + variantKey;
			}
		}

		return newName;
	}
982701
public static String getVariantKey(Map<String, String> variants) {

		String variantKey = "";
		if (variants != null) {
			variantKey = getVariantKey(variants, variants.keySet());
		}

		return variantKey;
	}
494369
@Override
	public void setVariants(Map<String, VariantSet> variantSets) {

		if (variantSets != null) {
			this.variants = new TreeMap<>(variantSets);
			variantKeys = VariantUtils.getAllVariantKeys(this.variants);
		}
	}
1098421
public static String getVariantKey(Map<String, String> curVariants, Set<String> variantTypes) {

		String variantKey = "";
		if (curVariants != null && variantTypes != null) {

			Map<String, String> tempVariants = new TreeMap<>(curVariants);
			StringBuilder variantKeyBuf = new StringBuilder();
			for (Entry<String, String> entry : tempVariants.entrySet()) {
				if (variantTypes.contains(entry.getKey())) {
					String value = entry.getValue();
					if (value == null) {
						value = "";
					}
					variantKeyBuf.append(value + JawrConstant.VARIANT_SEPARATOR_CHAR);
				}
			}

			variantKey = variantKeyBuf.toString();
			if (StringUtils.isNotEmpty(variantKey)
					&& variantKey.charAt(variantKey.length() - 1) == JawrConstant.VARIANT_SEPARATOR_CHAR) {
				variantKey = variantKey.substring(0, variantKey.length() - 1);
			}
		}

		return variantKey;
	}
591272
@Override
	public String getAvailableVariant(String variant, VariantSet variantSet) {
		String availableVariant = null;
		if (variantSet.contains(variant)) {
			availableVariant = variant;
		} else {
			String subVar = variant;
			while (subVar.indexOf('_') != -1) {
				subVar = subVar.substring(0, subVar.lastIndexOf('_'));
				if (variantSet.contains(subVar)) {
					availableVariant = subVar;
				}
			}
		}
		if (availableVariant == null) {
			availableVariant = variantSet.getDefaultVariant();
		}

		return availableVariant;
	}
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");
    }
255513
public JSType createUnionType(JSType... variants) {
    UnionTypeBuilder builder = UnionTypeBuilder.create(this);
    for (JSType type : variants) {
      builder.addAlternate(type);
    }
    return builder.build();
  }
442876
public static String getVariantBundleName(String bundleName, Map<String, String> variants,
			boolean isGeneratedResource) {

		String variantKey = getVariantKey(variants);
		return getVariantBundleName(bundleName, variantKey, isGeneratedResource);
	}
1342270
public static List<Variant> deNovoVariants(Member member, Iterator<Variant> variantIterator) {
        List<Variant> variantList = new ArrayList<>();

        while (variantIterator.hasNext()) {
            Variant variant = variantIterator.next();

            if (isDeNovoVariant(member, variant)) {
                variantList.add(variant);
            }
        }

        return variantList;
    }
425821
def _createGaVariant(self):
        
        ret = protocol.Variant()
        if self._creationTime:
            ret.created = self._creationTime
        if self._updatedTime:
            ret.updated = self._updatedTime
        ret.variant_set_id = self.getId()
        return ret
307322
def variant(case_id, variant_id):
    """"""
    case_obj = app.db.case(case_id)
    variant = app.db.variant(case_id, variant_id)
    if variant is None:
        return abort(404, "variant not found")

    comments = app.db.comments(variant_id=variant.md5)
    template = 'sv_variant.html' if app.db.variant_type == 'sv' else 'variant.html'
    return render_template(template, variant=variant, case_id=case_id,
                           comments=comments, case=case_obj)