@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Data
@EqualsAndHashCode(callSuper = false)
-public class ToscaEntrySchema extends PfConcept {
+public class JpaToscaEntrySchema extends PfConcept {
private static final long serialVersionUID = 3645882081163287058L;
@EmbeddedId
private String description;
@ElementCollection
- private List<ToscaConstraint> constraints;
+ private List<JpaToscaConstraint> constraints;
/**
- * The Default Constructor creates a {@link ToscaEntrySchema} object with a null key.
+ * The Default Constructor creates a {@link JpaToscaEntrySchema} object with a null key.
*/
- public ToscaEntrySchema() {
+ public JpaToscaEntrySchema() {
this(new PfReferenceKey());
}
/**
- * The Key Constructor creates a {@link ToscaEntrySchema} object with the given concept key.
+ * The Key Constructor creates a {@link JpaToscaEntrySchema} object with the given concept key.
*
* @param key the key
*/
- public ToscaEntrySchema(@NonNull final PfReferenceKey key) {
+ public JpaToscaEntrySchema(@NonNull final PfReferenceKey key) {
this(key, new PfConceptKey());
}
/**
- * The full constructor creates a {@link ToscaEntrySchema} object with mandatory fields.
+ * The full constructor creates a {@link JpaToscaEntrySchema} object with mandatory fields.
*
* @param key the key
* @param type the type of the entry schema
*/
- public ToscaEntrySchema(@NonNull final PfReferenceKey key, @NonNull final PfConceptKey type) {
+ public JpaToscaEntrySchema(@NonNull final PfReferenceKey key, @NonNull final PfConceptKey type) {
this.key = key;
this.type = type;
}
*
* @param copyConcept the concept to copy from
*/
- public ToscaEntrySchema(final ToscaEntrySchema copyConcept) {
+ public JpaToscaEntrySchema(final JpaToscaEntrySchema copyConcept) {
super(copyConcept);
}
keyList.addAll(type.getKeys());
if (constraints != null) {
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
keyList.addAll(constraint.getKeys());
}
}
description = (description != null ? description.trim() : null);
if (constraints != null) {
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
constraint.clean();
}
}
if (constraints != null) {
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
if (constraint == null) {
result.addValidationMessage(new PfValidationMessage(key, this.getClass(), ValidationResult.INVALID,
"property constraint may not be null "));
return this.hashCode() - otherConcept.hashCode();
}
- final ToscaEntrySchema other = (ToscaEntrySchema) otherConcept;
+ final JpaToscaEntrySchema other = (JpaToscaEntrySchema) otherConcept;
if (!key.equals(other.key)) {
return key.compareTo(other.key);
}
@Override
public PfConcept copyTo(@NonNull final PfConcept target) {
- Assertions.instanceOf(target, ToscaEntrySchema.class);
+ Assertions.instanceOf(target, JpaToscaEntrySchema.class);
- final ToscaEntrySchema copy = ((ToscaEntrySchema) target);
+ final JpaToscaEntrySchema copy = ((JpaToscaEntrySchema) target);
copy.setKey(new PfReferenceKey(key));
copy.setType(new PfConceptKey(type));
copy.setDescription(description);
if (constraints != null) {
- 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);