@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Data
@EqualsAndHashCode(callSuper = false)
-public class ToscaProperty extends PfConcept {
+public class JpaToscaProperty extends PfConcept {
private static final long serialVersionUID = 1675770231921107988L;
public enum Status {
private Status status = Status.SUPPORTED;
@ElementCollection
- private List<ToscaConstraint> constraints;
+ private List<JpaToscaConstraint> constraints;
@Column
@SerializedName("entry_schema")
- private ToscaEntrySchema entrySchema;
+ private JpaToscaEntrySchema entrySchema;
/**
- * The Default Constructor creates a {@link ToscaProperty} object with a null key.
+ * The Default Constructor creates a {@link JpaToscaProperty} object with a null key.
*/
- public ToscaProperty() {
+ public JpaToscaProperty() {
this(new PfReferenceKey());
}
/**
- * The Key Constructor creates a {@link ToscaProperty} object with the given concept key.
+ * The Key Constructor creates a {@link JpaToscaProperty} object with the given concept key.
*
* @param key the key
*/
- public ToscaProperty(@NonNull final PfReferenceKey key) {
+ public JpaToscaProperty(@NonNull final PfReferenceKey key) {
this(key, new PfConceptKey());
}
/**
- * The Key Constructor creates a {@link ToscaProperty} object with the given concept key.
+ * The Key Constructor creates a {@link JpaToscaProperty} object with the given concept key.
*
* @param key the key
* @param type the key of the property type
*/
- public ToscaProperty(@NonNull final PfReferenceKey key, @NonNull final PfConceptKey type) {
+ public JpaToscaProperty(@NonNull final PfReferenceKey key, @NonNull final PfConceptKey type) {
this.key = key;
this.type = type;
}
*
* @param copyConcept the concept to copy from
*/
- public ToscaProperty(final ToscaProperty copyConcept) {
+ public JpaToscaProperty(final JpaToscaProperty copyConcept) {
super(copyConcept);
}
keyList.addAll(type.getKeys());
if (constraints != null) {
- for (ToscaConstraint constraint : constraints) {
+ for (JpaToscaConstraint constraint : constraints) {
keyList.addAll(constraint.getKeys());
}
}
}
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 ToscaProperty other = (ToscaProperty) otherConcept;
+ final JpaToscaProperty other = (JpaToscaProperty) otherConcept;
if (!key.equals(other.key)) {
return key.compareTo(other.key);
}
*
* @param other the other ToscaProperty object
*/
- private int compareFields(final ToscaProperty other) {
+ private int compareFields(final JpaToscaProperty other) {
if (!type.equals(other.type)) {
return type.compareTo(other.type);
}
@Override
public PfConcept copyTo(@NonNull final PfConcept target) {
- Assertions.instanceOf(target, ToscaProperty.class);
+ Assertions.instanceOf(target, JpaToscaProperty.class);
- final ToscaProperty copy = ((ToscaProperty) target);
+ final JpaToscaProperty copy = ((JpaToscaProperty) target);
copy.setKey(new PfReferenceKey(key));
copy.setType(new PfConceptKey(type));
copy.setDescription(description);
copy.setDefaultValue(defaultValue);
copy.setStatus(status);
copy.constraints = constraints; // Constraints are immutable
- copy.setEntrySchema(entrySchema != null ? new ToscaEntrySchema(entrySchema) : null);
+ copy.setEntrySchema(entrySchema != null ? new JpaToscaEntrySchema(entrySchema) : null);
return copy;
}