public String getFirstValueEnum(final FunctionBlock fb, final PropertyType type) { EList<org.eclipse.vorto.core.api.model.datatype.Enum> _referencedEnums = Utils.getReferencedEnums(fb); for (final org.eclipse.vorto.core.api.model.datatype.Enum enum_ : _referencedEnums) { boolean _and = false; String _displayname = enum_.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { _and = false; } else { String _namespace = enum_.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and = _equals_1; } if (_and) { EList<EnumLiteral> _enums = enum_.getEnums(); EnumLiteral _get = _enums.get(0); return _get.getName(); } } return ""; }
public EList<Property> getEntity(final FunctionBlock fb, final PropertyType type) { EList<Entity> _referencedEntities = Utils.getReferencedEntities(fb); for (final Entity entity : _referencedEntities) { boolean _and = false; String _displayname = entity.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { _and = false; } else { String _namespace = entity.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and = _equals_1; } if (_and) { return entity.getProperties(); } } return null; } }
String _namespace = enum_.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and_1 = _equals_1;
String _namespace = entity.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and_1 = _equals_1;
private static void createReference(FunctionblockModel fbm, ObjectPropertyType type) { ModelReference reference = ModelFactory.eINSTANCE.createModelReference(); reference.setImportedNamespace(type.getType().getNamespace() + "." + type.getType().getName()); reference.setVersion(type.getType().getVersion()); fbm.getReferences().add(reference); }
private static void createReference(Entity entity, ObjectPropertyType type) { ModelReference reference = ModelFactory.eINSTANCE.createModelReference(); reference.setImportedNamespace(type.getType().getNamespace() + "." + type.getType().getName()); reference.setVersion(type.getType().getVersion()); entity.getReferences().add(reference); }
public String type(final PropertyType type) { if ((type instanceof PrimitivePropertyType)) { PrimitiveType _type = ((PrimitivePropertyType) type).getType(); return this.toCppPrimitive(_type); } else { if ((type instanceof DictionaryPropertyType)) { PropertyType _keyType = ((DictionaryPropertyType) type).getKeyType(); String _type_1 = this.type(_keyType); String _plus = ("map<" + _type_1); String _plus_1 = (_plus + ","); PropertyType _valueType = ((DictionaryPropertyType) type).getValueType(); String _type_2 = this.type(_valueType); String _plus_2 = (_plus_1 + _type_2); return (_plus_2 + ">"); } else { Type _type_3 = ((ObjectPropertyType) type).getType(); String _namespace = _type_3.getNamespace(); String _replace = _namespace.replace(".", "_"); String _plus_3 = (_replace + "::"); Type _type_4 = ((ObjectPropertyType) type).getType(); String _name = _type_4.getName(); return (_plus_3 + _name); } } }