Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NeqModPlus
de.hft-stuttgart.cityunits
Commits
e393da65
Commit
e393da65
authored
Mar 14, 2021
by
Kai-Holger Brassel
Browse files
Custom conversion methods between String and Quantities were missing
parent
842deb1a
Pipeline
#2231
passed with stage
in 2 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
de.hftstuttgart.cityunits.model/model/Quantities.genmodel
View file @
e393da65
...
...
@@ -7,9 +7,9 @@
<foreignModel>
Quantities.ecore
</foreignModel>
<genPackages
prefix=
"Quantities"
basePackage=
"de.hftstuttgart.cityunits.model"
disposableProviderFactory=
"true"
ecorePackage=
"Quantities.ecore#/"
>
<genDataTypes
ecoreDataType=
"Quantities.ecore#//QuantityDouble"
create=
"return de.hftstuttgart.units.NullableQuantity.create(it);"
<genDataTypes
ecoreDataType=
"Quantities.ecore#//QuantityDouble"
create=
"return de.hftstuttgart.
city
units.
model.
NullableQuantity.create(it);"
convert=
"return it == null ? null : it.toString();"
/>
<genDataTypes
ecoreDataType=
"Quantities.ecore#//QuantityLong"
create=
"return de.hftstuttgart.units.NullableQuantity.create(it);"
<genDataTypes
ecoreDataType=
"Quantities.ecore#//QuantityLong"
create=
"return de.hftstuttgart.
city
units.
model.
NullableQuantity.create(it);"
convert=
"return it == null ? null : it.toString();"
/>
</genPackages>
</genmodel:GenModel>
de.hftstuttgart.cityunits.model/src/de/hftstuttgart/cityunits/model/quantities/impl/QuantitiesFactoryImpl.java
View file @
e393da65
...
...
@@ -97,13 +97,31 @@ public class QuantitiesFactoryImpl extends EFactoryImpl implements QuantitiesFac
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public
NullableQuantity
createQuantityDouble
(
final
String
it
)
{
return
de
.
hftstuttgart
.
cityunits
.
model
.
NullableQuantity
.
create
(
it
);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public
NullableQuantity
createQuantityDoubleFromString
(
EDataType
eDataType
,
String
initialValue
)
{
return
(
NullableQuantity
)
super
.
createFromString
(
eDataType
,
initialValue
);
return
createQuantityDouble
(
initialValue
);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public
String
convertQuantityDouble
(
final
NullableQuantity
it
)
{
return
it
==
null
?
null
:
it
.
toString
();
}
/**
...
...
@@ -112,7 +130,16 @@ public class QuantitiesFactoryImpl extends EFactoryImpl implements QuantitiesFac
* @generated
*/
public
String
convertQuantityDoubleToString
(
EDataType
eDataType
,
Object
instanceValue
)
{
return
super
.
convertToString
(
eDataType
,
instanceValue
);
return
convertQuantityDouble
((
NullableQuantity
)
instanceValue
);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public
NullableQuantity
createQuantityLong
(
final
String
it
)
{
return
de
.
hftstuttgart
.
cityunits
.
model
.
NullableQuantity
.
create
(
it
);
}
/**
...
...
@@ -121,7 +148,16 @@ public class QuantitiesFactoryImpl extends EFactoryImpl implements QuantitiesFac
* @generated
*/
public
NullableQuantity
createQuantityLongFromString
(
EDataType
eDataType
,
String
initialValue
)
{
return
(
NullableQuantity
)
super
.
createFromString
(
eDataType
,
initialValue
);
return
createQuantityLong
(
initialValue
);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public
String
convertQuantityLong
(
final
NullableQuantity
it
)
{
return
it
==
null
?
null
:
it
.
toString
();
}
/**
...
...
@@ -130,7 +166,7 @@ public class QuantitiesFactoryImpl extends EFactoryImpl implements QuantitiesFac
* @generated
*/
public
String
convertQuantityLongToString
(
EDataType
eDataType
,
Object
instanceValue
)
{
return
super
.
convert
ToString
(
eDataType
,
instanceValue
);
return
convert
QuantityLong
((
NullableQuantity
)
instanceValue
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment