Tabnine Logo
BasePropertyCollector.translatePropertyList
Code IndexAdd Tabnine to your IDE (free)

How to use
translatePropertyList
method
in
ch.puzzle.itc.mobiliar.business.generator.control.extracted.properties.BasePropertyCollector

Best Java code snippets using ch.puzzle.itc.mobiliar.business.generator.control.extracted.properties.BasePropertyCollector.translatePropertyList (Showing top 11 results out of 315)

origin: liimaorg/liima

public Map<String, FreeMarkerProperty> propertiesForContext(final ContextEntity context) {
  Map<String, FreeMarkerProperty> result = translatePropertyList(utils().getPropertyValues(context),
      context.getName(), context.getId(), null, null, null);
  result.put(RESERVED_PROPERTY_DOMAIN, new FreeMarkerProperty(getDomainName(context), RESERVED_PROPERTY_DOMAIN));
  result.put(RESERVED_PROPERTY_NAME_ALIAS, new FreeMarkerProperty(context.getNameAlias(), RESERVED_PROPERTY_NAME_ALIAS));
  return result;
}
origin: liimaorg/liima

protected Map<String, FreeMarkerProperty> propertiesForRelation(final ResourceEntity resource,
    final ContextEntity context,
    final AbstractResourceRelationEntity relation) {
  return translatePropertyList(getPropertiesForRelation(context, relation),
      resource.getName(), resource.getId(), resource.getResourceGroup().getId(), null, null);
}
origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddAdditionalProperties() {
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(null,"name", Integer.valueOf(1), Integer.valueOf(2), "release", "outofServiceRel");
  
  // then
  assertNotNull(result);
  assertEquals(5, result.keySet().size());
  assertEquals("name", result.get("name").getCurrentValue());
  assertEquals("1", result.get("id").getCurrentValue());
  assertEquals("2", result.get("resGroupId").getCurrentValue());
  assertEquals("release", result.get("release").getCurrentValue());
  assertEquals("outofServiceRel", result.get("outOfServiceRelease").getCurrentValue());
  
}
origin: liimaorg/liima

@Test
public void translatePropertyList_shouldNotAddProperty_keyOptionalTrue_and_value_null() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(true);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue(null);
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(0, result.keySet().size());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldNotAddProperty_keyOptionalTrue_and_no_value() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(true);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue("");
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(0, result.keySet().size());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldNotAddProperty_keyOptionalTrue_and_no_value_but_default() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(true);
  d.setPropertyName("propName");
  d.setDefaultValue("defaultValue");
  
  p.setDescriptor(d);
  p.setValue("");
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(0, result.keySet().size());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddProperty_keyOptionalFalse_and_value() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue("value");
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals("value", result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddProperty_withDefaultValue_keyOptionalFalse_and_no_value() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setPropertyName("propName");
  d.setDefaultValue("defaultValue");
  
  p.setDescriptor(d);
  p.setValue(null);
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals("defaultValue", result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddEmptyProperty_whenValueOptionalAndNoValue() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setNullable(true);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue(null);
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals(null, result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddProperty_decriptedValue() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setPropertyName("propName");
  d.setEncrypt(true);
  
  p.setDescriptor(d);
  p.setValue(TemplateUtils.encrypt("value"));
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals("value", result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

public Map<String, FreeMarkerProperty> propertiesForResource(final ResourceEntity resource,
    final ContextEntity context,
    AMWTemplateExceptionHandler templateExceptionHandler) {
  String outOfServiceRelease = resource.getResourceGroup().getOutOfServiceRelease() != null ? resource.getResourceGroup().getOutOfServiceRelease().getName() : null;
  return translatePropertyList(getPropertiesForResource(resource, context, templateExceptionHandler),
      resource.getName(), resource.getId(), resource.getResourceGroup().getId(), resource.getRelease() != null ? resource.getRelease().getName() : null, outOfServiceRelease);
}
ch.puzzle.itc.mobiliar.business.generator.control.extracted.propertiesBasePropertyCollectortranslatePropertyList

Popular methods of BasePropertyCollector

  • propertiesForContext
  • <init>
  • getDomainName
  • getPropertiesForRelation
  • getPropertiesForResource
  • propertiesForRelation
  • propertiesForResource
  • utils

Popular in Java

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now