/** * Returns the '<em><b>Primitive Type</b></em>' literal with the specified name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param name the name. * @return the matching enumerator or <code>null</code>. * @generated */ public static PrimitiveType getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { PrimitiveType result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; }
public static String mapSimpleDatatype(PrimitiveType type) { if (type.compareTo(PrimitiveType.STRING) ==0) { return "String"; } else if (type.compareTo(PrimitiveType.DATETIME)==0) { return "java.util.Date"; } else { return type.getLiteral(); } }
/** * Returns the '<em><b>Primitive Type</b></em>' literal with the specified literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param literal the literal. * @return the matching enumerator or <code>null</code>. * @generated */ public static PrimitiveType get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { PrimitiveType result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; }
public final boolean checkPropertyConstraints(final PrimitiveType type, final Constraint cons) { boolean _xblockexpression = false; { String _literal = type.getLiteral(); String[] arr = this.valueTypeMap.get(_literal); boolean _or = false; boolean _equals = Objects.equal(arr, null); if (_equals) { _or = true; } else { final String[] _converted_arr = (String[])arr; ConstraintIntervalType _type = cons.getType(); String _literal_1 = _type.getLiteral(); boolean _contains = ((List<String>)Conversions.doWrapArray(_converted_arr)).contains(_literal_1); boolean _not = (!_contains); _or = _not; } if (_or) { this.setErrorMessage(DatatypeSystemMessage.ERROR_CONSTRAINTTYPE_INVALID); return false; } _xblockexpression = true; } return _xblockexpression; }
public static String getInitialValue(PrimitiveType type) { if (type.compareTo(PrimitiveType.STRING) == 0) { return "\"\""; } else if (type.compareTo(PrimitiveType.BOOLEAN) == 0) { return "false"; } else if (type.compareTo(PrimitiveType.INT) == 0) { return "0"; } else if (type.compareTo(PrimitiveType.FLOAT) == 0) { return "0.0f"; } else if (type.compareTo(PrimitiveType.DOUBLE) == 0) { return "0.0d"; } else if (type.compareTo(PrimitiveType.DATETIME) == 0) { return "new java.util.Date()"; } else if (type.compareTo(PrimitiveType.SHORT) == 0) { return "0"; } else if (type.compareTo(PrimitiveType.BASE64_BINARY) == 0) { return "null"; } return ""; } }
public static String mapSimpleDatatype(PrimitiveType type) { if (type.equals(PrimitiveType.STRING)) { return "String"; } else if (type.equals(PrimitiveType.INT)) { return "Int"; } else if (type.equals(PrimitiveType.DATETIME)) { return "NSDate"; } else if (type.equals(PrimitiveType.DOUBLE)) { return "Double"; } else if (type.equals(PrimitiveType.FLOAT)) { return "Float"; } else { return "String"; } } }
g.writeStringField("name", _name_1); PrimitiveType _type = ((PrimitiveParam) currentParam).getType(); String paramType = _type.getLiteral(); String _thingWorxDataType = this.getThingWorxDataType(paramType); g.writeStringField("baseType", _thingWorxDataType);
public static String getInitialValue(PrimitiveType type) { if (type.compareTo(PrimitiveType.STRING) ==0) { return "\"\""; } else if (type.compareTo(PrimitiveType.BOOLEAN) ==0) { return "false"; } else if (type.compareTo(PrimitiveType.INT) ==0) { return "0"; } else if (type.compareTo(PrimitiveType.FLOAT) ==0) { return "0.0f"; } else if (type.compareTo(PrimitiveType.DOUBLE) ==0) { return "0.0d"; } else if (type.compareTo(PrimitiveType.DATETIME) ==0) { return "new java.util.Date()"; } else if (type.compareTo(PrimitiveType.SHORT) ==0) { return "0"; } else if (type.compareTo(PrimitiveType.BASE64_BINARY) ==0) { return "null"; } return ""; } }
/** * Returns the '<em><b>Primitive Type</b></em>' literal with the specified name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param name the name. * @return the matching enumerator or <code>null</code>. * @generated */ public static PrimitiveType getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { PrimitiveType result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; }
public static String mapSimpleDatatype(PrimitiveType type) { if (type.compareTo(PrimitiveType.STRING) == 0) { return "String"; } else if (type.compareTo(PrimitiveType.DATETIME) == 0) { return "java.util.Date"; } else if (type.compareTo(PrimitiveType.BASE64_BINARY) == 0) { return "byte[]"; } else { return type.getLiteral(); } }
String typeStr = type.getLiteral(); boolean _matched = false; if (!_matched) {
public static String getInitialValue(PrimitiveType type) { if (type.compareTo(PrimitiveType.STRING) ==0) { return "\"\""; } else if (type.compareTo(PrimitiveType.BOOLEAN) ==0) { return "false"; } else if (type.compareTo(PrimitiveType.INT) ==0) { return "0"; } else if (type.compareTo(PrimitiveType.FLOAT) ==0) { return "0.0f"; } else if (type.compareTo(PrimitiveType.DOUBLE) ==0) { return "0.0d"; } else if (type.compareTo(PrimitiveType.DATETIME) ==0) { return "new java.util.Date()"; } else if (type.compareTo(PrimitiveType.SHORT) ==0) { return "0"; } else if (type.compareTo(PrimitiveType.BASE64_BINARY) ==0) { return "null"; } else if (type.compareTo(PrimitiveType.BYTE) == 0) { return "0"; } return ""; } }
/** * Returns the '<em><b>Primitive Type</b></em>' literal with the specified literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param literal the literal. * @return the matching enumerator or <code>null</code>. * @generated */ public static PrimitiveType get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { PrimitiveType result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; }
public static String getReturnType(final ReturnType type) { if ((type instanceof ReturnPrimitiveType)) { PrimitiveType _returnType = ((ReturnPrimitiveType) type).getReturnType(); return _returnType.getName(); } else { if ((type instanceof ReturnObjectType)) { Type _returnType_1 = ((ReturnObjectType) type).getReturnType(); return _returnType_1.getName(); } } return null; }
public static String mapSimpleDatatype(PrimitiveType type) { if (type.compareTo(PrimitiveType.STRING) ==0) { return "String"; } else if (type.compareTo(PrimitiveType.DATETIME)==0) { return "java.util.Date"; } else { return type.getLiteral(); } }
protected String getResultBaseType(final Operation operation) { boolean _and = false; ReturnType _returnType = operation.getReturnType(); boolean _notEquals = (!Objects.equal(_returnType, null)); if (!_notEquals) { _and = false; } else { ReturnType _returnType_1 = operation.getReturnType(); _and = (_returnType_1 instanceof ReturnPrimitiveType); } if (_and) { ReturnType _returnType_2 = operation.getReturnType(); boolean _isMultiplicity = _returnType_2.isMultiplicity(); boolean _equals = (_isMultiplicity == false); if (_equals) { ReturnType primitiveType = operation.getReturnType(); PrimitiveType _returnType_3 = ((ReturnPrimitiveType) primitiveType).getReturnType(); String typeName = _returnType_3.getLiteral(); return this.getThingWorxDataType(typeName); } else { return "COMPLEX_TYPE"; } } else { return "NOTHING"; } }
public static String getRandomValue(PropertyType type) { if (type instanceof ObjectPropertyType) { return "\"\""; } else { PrimitivePropertyType primitiveType = (PrimitivePropertyType) type; if (primitiveType.getType().compareTo(PrimitiveType.STRING) == 0) { return "\"\""; } else if (primitiveType.getType().compareTo(PrimitiveType.BOOLEAN) == 0) { return "new java.util.Random().nextBoolean()"; } else if (primitiveType.getType().compareTo(PrimitiveType.INT) == 0) { return "new java.util.Random().nextInt(100)"; } else if (primitiveType.getType().compareTo(PrimitiveType.FLOAT) == 0) { return "Math.round(new java.util.Random().nextFloat()*(float)100)"; } else if (primitiveType.getType().compareTo(PrimitiveType.DOUBLE) == 0) { return "Math.round(new java.util.Random().nextDouble()*(double)100)"; } else if (primitiveType.getType().compareTo(PrimitiveType.DATETIME) == 0) { return "new java.util.Date().getTime()"; } else if (primitiveType.getType().compareTo(PrimitiveType.SHORT) == 0) { return "new java.util.Random().nextInt(100)"; } else if (primitiveType.getType().compareTo(PrimitiveType.BASE64_BINARY) == 0) { return "null"; } else if (primitiveType.getType().compareTo(PrimitiveType.BYTE) == 0) { return "(byte) new java.util.Random().nextInt(100)"; } } return ""; }
protected String getPrimitivePropertyType(final Property property) { PropertyType _type = property.getType(); if ((_type instanceof PrimitivePropertyType)) { PropertyType _type_1 = property.getType(); PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType(); return _type_2.toString(); } else { return "UNDEFINED"; } }
/** * Returns the return type as string */ public static String getReturnTypeAsString(final Operation op) { ReturnType _returnType = op.getReturnType(); boolean _notEquals = (!Objects.equal(_returnType, null)); if (_notEquals) { ReturnType returnType = op.getReturnType(); if ((returnType instanceof ReturnObjectType)) { Type _returnType_1 = ((ReturnObjectType) returnType).getReturnType(); return _returnType_1.getName(); } else { if ((returnType instanceof ReturnPrimitiveType)) { PrimitiveType _returnType_2 = ((ReturnPrimitiveType) returnType).getReturnType(); return _returnType_2.getName(); } } } else { return "void"; } return null; }
public static String mapSimpleDatatype(PropertyType type) { if (type instanceof ObjectPropertyType) { return "String"; } else { PrimitivePropertyType primitiveType = (PrimitivePropertyType) type; if (primitiveType.getType().compareTo(PrimitiveType.STRING) == 0) { return "String"; } else if (primitiveType.getType().compareTo(PrimitiveType.DATETIME) == 0) { return "java.util.Date"; } else { return primitiveType.getType().getLiteral(); } } }