import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
-
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@ToString(callSuper = true)
-public class ToscaPolicy extends ToscaEntity {
+public class ToscaPolicy extends ToscaEntity implements Comparable<ToscaPolicy> {
private String type;
private String typeVersion;
}
}
}
+
+ /**
+ * Gets the identifier for this policy.
+ *
+ * @return this policy's identifier
+ */
+ public ToscaPolicyIdentifier getIdentifier() {
+ return new ToscaPolicyIdentifier(getName(), getVersion());
+ }
+
+ /**
+ * Gets the type identifier for this policy.
+ *
+ * @return this policy's type identifier
+ */
+ public ToscaPolicyTypeIdentifier getTypeIdentifier() {
+ return new ToscaPolicyTypeIdentifier(getType(), getTypeVersion());
+ }
+
+ @Override
+ public int compareTo(final ToscaPolicy other) {
+ return compareNameVersion(this, other);
+ }
}