@@ -162,7 +162,7 @@ ImmutableMap.<Resource, DataTypeDefXSD> builder()
162
162
.put ( XSD .xint , DataTypeDefXSD .INT )
163
163
.put ( XSD .integer , DataTypeDefXSD .INTEGER )
164
164
.put ( XSD .xlong , DataTypeDefXSD .LONG )
165
- .put ( XSD .negativeInteger , DataTypeDefXSD .NEGATIVE_INTEGER )
165
+ .put ( XSD .negativeInteger , DataTypeDefXSD .NEGATIVE_INTEGER )
166
166
.put ( XSD .nonNegativeInteger , DataTypeDefXSD .NON_NEGATIVE_INTEGER )
167
167
.put ( XSD .positiveInteger , DataTypeDefXSD .POSITIVE_INTEGER )
168
168
.put ( XSD .xshort , DataTypeDefXSD .SHORT )
@@ -193,8 +193,8 @@ public Environment visitAspect( final Aspect aspect, Context context ) {
193
193
if ( context == null ) {
194
194
final Submodel submodel = new DefaultSubmodel .Builder ().build ();
195
195
Environment environment = new DefaultEnvironment .Builder ().submodels ( Collections .singletonList ( submodel ) ).build ();
196
- context = new Context (environment , submodel );
197
- context .setEnvironment (environment );
196
+ context = new Context ( environment , submodel );
197
+ context .setEnvironment ( environment );
198
198
}
199
199
200
200
final Submodel submodel = context .getSubmodel ();
@@ -210,7 +210,7 @@ public Environment visitAspect( final Aspect aspect, Context context ) {
210
210
final AssetAdministrationShell administrationShell =
211
211
new DefaultAssetAdministrationShell .Builder ()
212
212
.idShort ( ID_PREFIX + ADMIN_SHELL_NAME )
213
- .description ( createLangStringTextType ( "en" , ADMIN_SHELL_NAME ) )
213
+ .description ( createLangStringTextType ( "en" , ADMIN_SHELL_NAME ) )
214
214
.id ( ADMIN_SHELL_NAME )
215
215
.administration ( new DefaultAdministrativeInformation .Builder ().build () )
216
216
.assetInformation ( new DefaultAssetInformation .Builder ().assetKind ( AssetKind .INSTANCE ).build () )
@@ -234,8 +234,8 @@ private List<SubmodelElement> visitOperations(
234
234
private List <SubmodelElement > visitProperties (
235
235
final List <Property > elements , final Context context ) {
236
236
return elements .stream ().map ( i -> mapText ( i , context ) )
237
- .filter (Optional ::isPresent )
238
- .map (Optional ::get )
237
+ .filter ( Optional ::isPresent )
238
+ .map ( Optional ::get )
239
239
.collect ( Collectors .toList () );
240
240
}
241
241
@@ -253,7 +253,8 @@ private Optional<SubmodelElement> mapText( final Property property, final Contex
253
253
property .getAspectModelUrn ().map ( AspectModelUrn ::toString ).orElse ( "(unknown)" ) ) );
254
254
return defaultResultForProperty ;
255
255
} else {
256
- LOG .error ( String .format ( "Having a recursive property: %s which is not optional is not valid. Check the model. Property will be excluded from AAS mapping." ,
256
+ LOG .error ( String .format (
257
+ "Having a recursive property: %s which is not optional is not valid. Check the model. Property will be excluded from AAS mapping." ,
257
258
property .getAspectModelUrn ().map ( AspectModelUrn ::toString ).orElse ( "(unknown)" ) ) );
258
259
}
259
260
return defaultResultForProperty ;
@@ -308,17 +309,17 @@ private SubmodelElementCollection mapToAasSubModelElementCollection( final Entit
308
309
private org .eclipse .digitaltwin .aas4j .v3 .model .Property mapToAasProperty ( final Property property ) {
309
310
return new DefaultProperty .Builder ()
310
311
.idShort ( ID_PREFIX + property .getName () )
311
- .valueType ( mapAASXSDataType ( property .getCharacteristic ().flatMap ( Characteristic ::getDataType ).map ( this ::mapType ).orElse ( UNKNOWN_TYPE ) ) )
312
+ .valueType ( mapAASXSDataType ( property .getCharacteristic ().flatMap ( Characteristic ::getDataType ).map ( this ::mapType ).orElse ( UNKNOWN_TYPE ) ) )
312
313
.displayName ( mapName ( property .getPreferredNames () ) )
313
314
.value ( property .getExampleValue ().map ( i -> i .getValue ().toString () ).orElse ( UNKNOWN_EXAMPLE ) )
314
315
.description ( mapText ( property .getDescriptions () ) )
315
316
.semanticID ( buildReferenceToConceptDescription ( property ) ) // link to the conceptDescription containing the details for the Characteristic
316
- .supplementalSemanticIds ( buildReferencesForSeeElements (property .getSee ()) )
317
+ .supplementalSemanticIds ( buildReferencesForSeeElements ( property .getSee () ) )
317
318
.build ();
318
319
}
319
320
320
321
private String extractIdentifier ( final NamedElement element ) {
321
- return determineIdentifierFor ( element );
322
+ return determineIdentifierFor ( element );
322
323
}
323
324
324
325
private String mapType ( final Type type ) {
@@ -373,29 +374,26 @@ private LangStringPreferredNameTypeIec61360 mapLangStringPreferredNameTypeIec613
373
374
return createLangStringPreferredNameTypeIec61360 ( langString .getLanguageTag ().getLanguage (), langString .getValue () );
374
375
}
375
376
376
-
377
- private LangStringTextType createLangStringTextType (String locale , String text ){
377
+ private LangStringTextType createLangStringTextType ( String locale , String text ) {
378
378
return new DefaultLangStringTextType .Builder ().language ( locale ).text ( text ).build ();
379
379
}
380
380
381
- private LangStringNameType createLangStringNameType (String locale , String text ) {
381
+ private LangStringNameType createLangStringNameType ( String locale , String text ) {
382
382
return new DefaultLangStringNameType .Builder ().language ( locale ).text ( text ).build ();
383
383
}
384
384
385
- private LangStringShortNameTypeIec61360 createLangStringShortNameTypeIec61360 (String locale , String text ) {
385
+ private LangStringShortNameTypeIec61360 createLangStringShortNameTypeIec61360 ( String locale , String text ) {
386
386
return new DefaultLangStringShortNameTypeIec61360 .Builder ().language ( locale ).text ( text ).build ();
387
387
}
388
388
389
- private LangStringDefinitionTypeIec61360 createLangStringDefinitionTypeIec61360 (String locale , String text ) {
389
+ private LangStringDefinitionTypeIec61360 createLangStringDefinitionTypeIec61360 ( String locale , String text ) {
390
390
return new DefaultLangStringDefinitionTypeIec61360 .Builder ().language ( locale ).text ( text ).build ();
391
391
}
392
392
393
- private LangStringPreferredNameTypeIec61360 createLangStringPreferredNameTypeIec61360 (String locale , String text ) {
393
+ private LangStringPreferredNameTypeIec61360 createLangStringPreferredNameTypeIec61360 ( String locale , String text ) {
394
394
return new DefaultLangStringPreferredNameTypeIec61360 .Builder ().language ( locale ).text ( text ).build ();
395
395
}
396
396
397
-
398
-
399
397
private Reference buildReferenceToEnumValue ( final Enumeration enumeration , final Object value ) {
400
398
final Key key =
401
399
new DefaultKey .Builder ()
@@ -483,14 +481,14 @@ private void createConceptDescription( final Aspect aspect, final Context contex
483
481
484
482
private EmbeddedDataSpecification extractEmbeddedDataSpecification ( final Property property ) {
485
483
return new DefaultEmbeddedDataSpecification .Builder ()
486
- .dataSpecification ( buildReferenceForSeeElement ( property .getAspectModelUrn ().toString () ) )
484
+ .dataSpecification ( buildReferenceForSeeElement ( property .getAspectModelUrn ().toString () ) )
487
485
.dataSpecificationContent ( extractDataSpecificationContent ( property ) )
488
486
.build ();
489
487
}
490
488
491
489
private EmbeddedDataSpecification extractEmbeddedDataSpecification ( final Aspect aspect ) {
492
490
return new DefaultEmbeddedDataSpecification .Builder ()
493
- .dataSpecification ( buildReferenceForSeeElement ( aspect .getAspectModelUrn ().toString () ) )
491
+ .dataSpecification ( buildReferenceForSeeElement ( aspect .getAspectModelUrn ().toString () ) )
494
492
.dataSpecificationContent ( extractDataSpecificationContent ( aspect ) )
495
493
.build ();
496
494
}
@@ -502,8 +500,8 @@ private DataSpecificationIec61360 extractDataSpecificationContent( final Propert
502
500
.collect ( Collectors .toList () );
503
501
504
502
final List <LangStringPreferredNameTypeIec61360 > preferredNames = property .getPreferredNames ().size () > 0 ?
505
- property .getPreferredNames ().stream ().map ( this ::mapLangStringPreferredNameTypeIec61360 ).collect ( Collectors .toList ()) :
506
- Collections .singletonList (createLangStringPreferredNameTypeIec61360 (DEFAULT_LOCALE , property .getName ()) );
503
+ property .getPreferredNames ().stream ().map ( this ::mapLangStringPreferredNameTypeIec61360 ).collect ( Collectors .toList () ) :
504
+ Collections .singletonList ( createLangStringPreferredNameTypeIec61360 ( DEFAULT_LOCALE , property .getName () ) );
507
505
508
506
return new DefaultDataSpecificationIec61360 .Builder ()
509
507
.definition ( definitions )
@@ -513,16 +511,15 @@ private DataSpecificationIec61360 extractDataSpecificationContent( final Propert
513
511
.build ();
514
512
}
515
513
516
-
517
514
private DataSpecificationIec61360 extractDataSpecificationContent ( final Aspect aspect ) {
518
- List <LangStringPreferredNameTypeIec61360 > preferredNames = aspect .getPreferredNames ().size () > 0 ?
519
- aspect .getPreferredNames ().stream ().map ( this ::mapLangStringPreferredNameTypeIec61360 ).collect ( Collectors .toList ()) :
520
- Collections .singletonList (createLangStringPreferredNameTypeIec61360 (DEFAULT_LOCALE , aspect .getName ()) );
515
+ List <LangStringPreferredNameTypeIec61360 > preferredNames = aspect .getPreferredNames ().size () > 0 ?
516
+ aspect .getPreferredNames ().stream ().map ( this ::mapLangStringPreferredNameTypeIec61360 ).collect ( Collectors .toList () ) :
517
+ Collections .singletonList ( createLangStringPreferredNameTypeIec61360 ( DEFAULT_LOCALE , aspect .getName () ) );
521
518
522
- return new DefaultDataSpecificationIec61360 .Builder ()
523
- .definition ( aspect .getDescriptions ().stream ().map ( this ::mapDefinitionIec61360 ).collect ( Collectors .toList ()) )
524
- .preferredName ( preferredNames )
525
- .build ();
519
+ return new DefaultDataSpecificationIec61360 .Builder ()
520
+ .definition ( aspect .getDescriptions ().stream ().map ( this ::mapDefinitionIec61360 ).collect ( Collectors .toList () ) )
521
+ .preferredName ( preferredNames )
522
+ .build ();
526
523
527
524
}
528
525
@@ -595,7 +592,8 @@ public Environment visitSet(
595
592
final org .eclipse .esmf .characteristic .Set set , final Context context ) {
596
593
final SubmodelElementBuilder builder =
597
594
( property ) ->
598
- new DefaultSubmodelElementCollection .Builder () //TODO according to the standard document this should be SubmodelEleementStruct. However, this type is not available in AAS4J
595
+ new DefaultSubmodelElementCollection .Builder () //TODO according to the standard document this should be SubmodelEleementStruct. However,
596
+ // this type is not available in AAS4J
599
597
.idShort ( ID_PREFIX + property .getName () )
600
598
.displayName ( mapName ( property .getPreferredNames () ) )
601
599
.description ( mapText ( property .getDescriptions () ) )
0 commit comments