public String getValue(String paramName) { DestContextParamType param = map.getMap().get(paramName); return param != null ? param.getValue() : null; }
private String getParameterValue(DestContextTypeMap destContext, DestContextParameters parameter) { return destContext.getMap().get(parameter.getName()).getValue(); }
/** * Gets the parameter value. * * @param templateParameter a enum defining the parameter name * @return a parameter value. */ public String getParameterValue(TemplateParameter templateParameter) { if (destContextMap == null) { throw new TemplateParameterNotFoundException( templateParameter.toString(), "Dest context for configuration doesn't set."); } DestContextParamType param = destContextMap.getMap().get(templateParameter.getName()); return param != null ? param.getValue() : null; }
@Test public void testBuildCorrectVideoFormat() throws Exception { InputDestContextResolveStrategy strategy = new InputDestContextResolveStrategy(contextProvider, ITunesPackageType.film, new FakeVideoDestContextResolveStrategy()); DestContextTypeMap map = strategy.resolveContext(new DestContextsTypeMap()); assertEquals("720", map.getMap().get(DestContextParameters.WIDTH.getName()).getValue()); assertEquals("480", map.getMap().get(DestContextParameters.HEIGHT.getName()).getValue()); assertEquals("25 1", map.getMap().get(DestContextParameters.FRAME_RATE.getName()).getValue()); // assume video scan type is progressive (according to IMF application #2E) assertEquals("false", map.getMap().get(DestContextParameters.INTERLACED.getName()).getValue()); assertEquals(ITunesPackageType.film.getName(), map.getMap().get(DEST_PARAM_VIDEO_SPECIFIED_FOR).getValue()); } }