[#1509] Sync Target type with SW and DS types (#1512)

Unifies Target type with the other types
* _TargetType_ made to inhert type, thus
* _TargetType_ now has immutable _key_
* add _AbstractJpaTypeEntity_ abstraction that implement the common 'type' JPA functionallity

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2023-12-12 15:24:57 +02:00
committed by GitHub
parent 4289f464c5
commit 71a5319019
12 changed files with 157 additions and 119 deletions

View File

@@ -16,11 +16,17 @@ import java.util.Set;
* {@link Target}
*
*/
public interface TargetType extends NamedEntity {
public interface TargetType extends Type {
/**
* Maximum length of color in Management UI.
* Target type doesn't support soft-delete so all target type instandces re not deleted.
*
* @return <code>false</code>
*/
int COLOUR_MAX_SIZE = 16;
@Override
default boolean isDeleted() {
return false;
}
/**
* @return immutable set of optional {@link DistributionSetType}s
@@ -32,18 +38,6 @@ public interface TargetType extends NamedEntity {
*/
Set<Target> getTargets();
/**
* Checks if the given {@link DistributionSetType} is in
* {@link #getCompatibleDistributionSetTypes()}.
*
* @param distributionSetType
* search for
* @return <code>true</code> if found
*/
default boolean containsCompatibleDistributionSetType(final DistributionSetType distributionSetType) {
return containsCompatibleDistributionSetType(distributionSetType.getId());
}
/**
* Checks if the given {@link DistributionSetType} is in
* {@link #getCompatibleDistributionSetTypes()}.
@@ -64,9 +58,4 @@ public interface TargetType extends NamedEntity {
* @return the resulting target type
*/
TargetType removeDistributionSetType(final Long dsTypeId);
/**
* @return get color code to be used in management UI views.
*/
String getColour();
}