package com.l7tech.identity;

import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.migration.Migration;
import com.l7tech.objectmodel.migration.MigrationMappingSelection;
import com.l7tech.objectmodel.migration.PropertyResolver.Type;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class GroupBean implements Group, Serializable {
   private static final long serialVersionUID = -2260828785148311161L;
   private String uniqueId;
   private String name;
   private String description;
   private Goid providerId;
   private Map<String, String> properties;
   private int version;

   public GroupBean(Goid var1, String var2) {
      this.providerId = var1;
      this.name = var2;
   }

   public GroupBean() {
   }

   public String getId() {
      return this.uniqueId;
   }

   public void setUniqueIdentifier(String var1) {
      this.uniqueId = var1;
   }

   @Override
   public String getDescription() {
      return this.description;
   }

   public void setDescription(String var1) {
      this.description = var1;
   }

   @Override
   public String getName() {
      return this.name;
   }

   public void setName(String var1) {
      this.name = var1;
   }

   public int getVersion() {
      return this.version;
   }

   public void setVersion(int var1) {
      this.version = var1;
   }

   @Migration(mapName = MigrationMappingSelection.NONE, mapValue = MigrationMappingSelection.NONE, export = false, resolver = Type.ID_PROVIDER_CONFIG)
   @Override
   public Goid getProviderId() {
      return this.providerId;
   }

   @Override
   public boolean isEquivalentId(Object var1) {
      return this.uniqueId != null && this.uniqueId.equals(var1);
   }

   public Map<String, String> getProperties() {
      if (this.properties == null) {
         this.properties = new HashMap<>();
      }

      return this.properties;
   }

   public void setProperties(Map<String, String> var1) {
      this.properties = var1;
   }

   @Override
   public boolean equals(Object var1) {
      if (this == var1) {
         return true;
      }

      if (var1 != null && this.getClass() == var1.getClass()) {
         GroupBean var2 = (GroupBean)var1;
         if (this.providerId != null ? this.providerId.equals(var2.providerId) : var2.providerId == null) {
            if (this.description != null ? this.description.equals(var2.description) : var2.description == null) {
               if (this.name != null ? this.name.equals(var2.name) : var2.name == null) {
                  return this.properties != null ? this.properties.equals(var2.properties) : var2.properties == null;
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      } else {
         return false;
      }
   }

   @Override
   public int hashCode() {
      int var1 = this.name != null ? this.name.hashCode() : 0;
      var1 = 31 * var1 + (this.providerId != null ? this.providerId.hashCode() : 0);
      var1 = 31 * var1 + (this.description != null ? this.description.hashCode() : 0);
      return 31 * var1 + (this.properties != null ? this.properties.hashCode() : 0);
   }

   public void setProviderId(Goid var1) {
      this.providerId = var1;
   }
}
