@Override
 public int hashCode() {
   int result = propertyConstraintsList != null ? propertyConstraintsList.hashCode() : 0;
   result = 31 * result + (config != null ? config.hashCode() : 0);
   result = 31 * result + (type != null ? type.hashCode() : 0);
   result = 31 * result + (templateRef != null ? templateRef.hashCode() : 0);
   return result;
 }
  public ObjectPolicyConfigurationTypeDto preparePolicyConfig() {
    ObjectPolicyConfigurationTypeDto newConfig = new ObjectPolicyConfigurationTypeDto();

    newConfig.setConstraints(propertyConstraintsList);
    newConfig.setType(type);

    ObjectReferenceType ref = new ObjectReferenceType();
    if (templateRef != null) {
      ref.setOid(templateRef.getOid());
      ref.setType(ObjectTemplateType.COMPLEX_TYPE);
    }

    newConfig.setTemplateRef(ref);

    return newConfig;
  }
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof ObjectPolicyDialogDto)) return false;

    ObjectPolicyDialogDto that = (ObjectPolicyDialogDto) o;

    if (config != null ? !config.equals(that.config) : that.config != null) return false;
    if (propertyConstraintsList != null
        ? !propertyConstraintsList.equals(that.propertyConstraintsList)
        : that.propertyConstraintsList != null) return false;
    if (templateRef != null ? !templateRef.equals(that.templateRef) : that.templateRef != null)
      return false;
    if (type != null ? !type.equals(that.type) : that.type != null) return false;

    return true;
  }