-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#534 implement record relation within the pojo class
- Loading branch information
1 parent
1249381
commit 6a092b7
Showing
29 changed files
with
746 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
.../src/main/java/com/boozallen/aiops/mda/metamodel/element/BaseRecordRelationDecorator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.boozallen.aiops.mda.metamodel.element; | ||
|
||
/*- | ||
* #%L | ||
* AIOps Foundation::AIOps MDA | ||
* %% | ||
* Copyright (C) 2021 Booz Allen | ||
* %% | ||
* This software package is licensed under the Booz Allen Public License. All Rights Reserved. | ||
* #L% | ||
*/ | ||
|
||
import org.technologybrewery.fermenter.mda.metamodel.element.MetamodelUtils; | ||
|
||
/** | ||
* Provides baseline decorator functionality for {@link Relation}. | ||
* | ||
* The goal is to make it easier to apply the decorator pattern in various implementations of generators (e.g., Java, | ||
* python, Docker) so that each concrete decorator only has to decorate those aspects of the class that are needed, not | ||
* all the pass-through methods that each decorator would otherwise need to implement (that add no real value). | ||
*/ | ||
public class BaseRecordRelationDecorator implements Relation { | ||
|
||
protected Relation wrapped; | ||
|
||
/** | ||
* New decorator for {@link Relation}. | ||
* | ||
* @param relationToDecorate | ||
* instance to decorate | ||
*/ | ||
public BaseRecordRelationDecorator(Relation relationToDecorate) { | ||
MetamodelUtils.validateWrappedInstanceIsNonNull(getClass(), relationToDecorate); | ||
wrapped = relationToDecorate; | ||
} | ||
|
||
@Override | ||
public String getDocumentation() { | ||
return wrapped.getDocumentation(); | ||
} | ||
|
||
@Override | ||
public Multiplicity getMultiplicity() { | ||
return wrapped.getMultiplicity(); | ||
} | ||
|
||
@Override | ||
public String getPackage() { | ||
return wrapped.getPackage(); | ||
} | ||
|
||
@Override | ||
public String getFileName() { | ||
return wrapped.getFileName(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return wrapped.getName(); | ||
} | ||
|
||
@Override | ||
public void validate() { | ||
wrapped.validate(); | ||
} | ||
|
||
/** | ||
* Check if the relation multiplicity is One to Many | ||
* @return true or false value | ||
*/ | ||
public boolean isOneToManyRelation() { | ||
return wrapped.getMultiplicity().equals(Multiplicity.ONE_TO_MANY); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.