@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Data
@EqualsAndHashCode(callSuper = true)
-public class ToscaDataType extends ToscaEntityType {
+public class JpaToscaDataType extends JpaToscaEntityType {
private static final long serialVersionUID = -3922690413436539164L;
@ElementCollection
- private List<ToscaConstraint> constraints;
+ private List<JpaToscaConstraint> constraints;
@ElementCollection
- private List<ToscaProperty> properties;
+ private List<JpaToscaProperty> properties;
/**
- * The Default Constructor creates a {@link ToscaDataType} object with a null key.
+ * The Default Constructor creates a {@link JpaToscaDataType} object with a null key.
*/
- public ToscaDataType() {
+ public JpaToscaDataType() {
this(new PfConceptKey());
}
/**
- * The Key Constructor creates a {@link ToscaDataType} object with the given concept key.
+ * The Key Constructor creates a {@link JpaToscaDataType} object with the given concept key.
*
* @param key the key
*/
- public ToscaDataType(@NonNull final PfConceptKey key) {
+ public JpaToscaDataType(@NonNull final PfConceptKey key) {
super(key);
}
*
* @param copyConcept the concept to copy from
*/
- public ToscaDataType(final ToscaDataType copyConcept) {
+ public JpaToscaDataType(final JpaToscaDataType copyConcept) {
super(copyConcept);
}
final List<PfKey> keyList = super.getKeys();
if (constraints != null) {
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
keyList.addAll(constraint.getKeys());
}
}
if (properties != null) {
- for (ToscaProperty property : properties) {
+ for (JpaToscaProperty property : properties) {
keyList.addAll(property.getKeys());
}
}
super.clean();
if (constraints != null) {
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
constraint.clean();
}
}
if (properties != null) {
- for (ToscaProperty property : properties) {
+ for (JpaToscaProperty property : properties) {
property.clean();
}
}
private PfValidationResult validateConstraints(@NonNull final PfValidationResult resultIn) {
PfValidationResult result = resultIn;
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
if (constraint == null) {
result.addValidationMessage(new PfValidationMessage(getKey(), this.getClass(), ValidationResult.INVALID,
"data type constraint may not be null "));
private PfValidationResult validateProperties(final PfValidationResult resultIn) {
PfValidationResult result = resultIn;
- for (ToscaProperty property : properties) {
+ for (JpaToscaProperty property : properties) {
if (property == null) {
result.addValidationMessage(new PfValidationMessage(getKey(), this.getClass(), ValidationResult.INVALID,
"data type property may not be null "));
return this.hashCode() - otherConcept.hashCode();
}
- final ToscaDataType other = (ToscaDataType) otherConcept;
+ final JpaToscaDataType other = (JpaToscaDataType) otherConcept;
if (!super.equals(other)) {
return super.compareTo(other);
}
final Object copyObject = target;
Assertions.instanceOf(copyObject, PfConcept.class);
- final ToscaDataType copy = ((ToscaDataType) copyObject);
+ final JpaToscaDataType copy = ((JpaToscaDataType) copyObject);
super.copyTo(target);
if (constraints == null) {
copy.setConstraints(null);
}
else {
- final List<ToscaConstraint> newConstraints = new ArrayList<>();
- for (final ToscaConstraint constraint : constraints) {
+ final List<JpaToscaConstraint> newConstraints = new ArrayList<>();
+ for (final JpaToscaConstraint constraint : constraints) {
newConstraints.add(constraint); // Constraints are immutable
}
copy.setConstraints(newConstraints);
copy.setProperties(null);
}
else {
- final List<ToscaProperty> newProperties = new ArrayList<>();
- for (final ToscaProperty property : properties) {
- newProperties.add(new ToscaProperty(property));
+ final List<JpaToscaProperty> newProperties = new ArrayList<>();
+ for (final JpaToscaProperty property : properties) {
+ newProperties.add(new JpaToscaProperty(property));
}
copy.setProperties(newProperties);
}