package com.l7tech.external.assertions.gatewaygraphql.server.data;

import com.fasterxml.jackson.annotation.JsonIncludeProperties;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.JsonNode;
import com.l7tech.external.assertions.gatewaygraphql.server.input.EntityInput;
import com.l7tech.external.assertions.gatewaygraphql.server.resolver.helper.GenericEntityHelper;
import com.l7tech.policy.GenericEntity;
import java.util.List;
import java.util.logging.Logger;
import lombok.Generated;

public class GenericEntityDTO extends EntityDTO<GenericEntity> {
   @Generated
   private static final Logger a = Logger.getLogger(GenericEntityDTO.class.getName());
   GenericEntityHelper b;

   public GenericEntityDTO(GenericEntity var1, GenericEntityHelper var2) {
      super(var1);
      this.b = var2;
   }

   @Override
   protected Object createWrapperObject() {
      return new GenericEntityDTO.GenericEntityWrapper(this.entity, this.b);
   }

   public String getDescription() {
      return this.entity.getDescription();
   }

   public Boolean isEnabled() {
      return this.entity.isEnabled();
   }

   public String getEntityClassName() {
      return this.entity.getEntityClassName();
   }

   public String getValueXml() {
      return this.entity.getValueXml();
   }

   public JsonNode getValueJson() {
      return this.b.getValueJson(this.entity);
   }

   public static class GenericEntitiesPayload extends EntityMutationsPayload<GenericEntityDTO> {
      public List<GenericEntityDTO> getGenericEntities() {
         return super.getItems();
      }
   }

   public static class GenericEntityInput extends EntityInput {
      private String g;
      private String h;
      private boolean i;
      private String j;
      private String k;
      private String l;
      private JsonNode m;
      private static final String[] n;

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

      @Generated
      public String getChecksum() {
         return this.h;
      }

      @Generated
      public boolean isEnabled() {
         return this.i;
      }

      @Generated
      public String getDescription() {
         return this.j;
      }

      @Generated
      public String getValueXml() {
         return this.k;
      }

      @Generated
      public String getEntityClassName() {
         return this.l;
      }

      @Generated
      public JsonNode getValueJson() {
         return this.m;
      }

      @Generated
      public void setName(String var1) {
         this.g = var1;
      }

      @Generated
      public void setChecksum(String var1) {
         this.h = var1;
      }

      @Generated
      public void setEnabled(boolean var1) {
         this.i = var1;
      }

      @Generated
      public void setDescription(String var1) {
         this.j = var1;
      }

      @Generated
      public void setValueXml(String var1) {
         this.k = var1;
      }

      @Generated
      public void setEntityClassName(String var1) {
         this.l = var1;
      }

      @Generated
      public void setValueJson(JsonNode var1) {
         this.m = var1;
      }

      @Generated
      @Override
      public String toString() {
         String var10000 = this.getName();
         String var10001 = this.getChecksum();
         boolean var10002 = this.isEnabled();
         String var10003 = this.getDescription();
         String var10004 = this.getValueXml();
         String var1 = String.valueOf(this.getValueJson());
         String var2 = this.getEntityClassName();
         String var3 = var10004;
         String var4 = var10003;
         boolean var5 = var10002;
         String var6 = var10001;
         String var7 = var10000;
         String[] var8 = n;
         return var8[5] + var7 + var8[4] + var6 + var8[1] + var5 + var8[6] + var4 + var8[2] + var3 + var8[3] + var2 + var8[0] + var1 + ")";
      }

      @Generated
      @Override
      public boolean equals(Object var1) {
         if (var1 == this) {
            return true;
         } else if (!(var1 instanceof GenericEntityDTO.GenericEntityInput var2)) {
            return false;
         } else {
            if (!var2.canEqual(this)) {
               return false;
            }

            if (!super.equals(var1)) {
               return false;
            }

            if (this.isEnabled() != var2.isEnabled()) {
               return false;
            }

            String var3 = this.getName();
            String var4 = var2.getName();
            if (var3 == null ? var4 == null : var3.equals(var4)) {
               String var5 = this.getChecksum();
               String var6 = var2.getChecksum();
               if (var5 == null ? var6 == null : var5.equals(var6)) {
                  String var7 = this.getDescription();
                  String var8 = var2.getDescription();
                  if (var7 == null ? var8 == null : var7.equals(var8)) {
                     String var9 = this.getValueXml();
                     String var10 = var2.getValueXml();
                     if (var9 == null ? var10 == null : var9.equals(var10)) {
                        String var11 = this.getEntityClassName();
                        String var12 = var2.getEntityClassName();
                        if (var11 == null ? var12 == null : var11.equals(var12)) {
                           JsonNode var13 = this.getValueJson();
                           JsonNode var14 = var2.getValueJson();
                           return var13 == null ? var14 == null : var13.equals(var14);
                        } else {
                           return false;
                        }
                     } else {
                        return false;
                     }
                  } else {
                     return false;
                  }
               } else {
                  return false;
               }
            } else {
               return false;
            }
         }
      }

      @Generated
      @Override
      protected boolean canEqual(Object var1) {
         return var1 instanceof GenericEntityDTO.GenericEntityInput;
      }

      @Generated
      @Override
      public int hashCode() {
         byte var1 = 59;
         int var2 = super.hashCode();
         var2 = var2 * 59 + (this.isEnabled() ? 79 : 97);
         String var3 = this.getName();
         var2 = var2 * 59 + (var3 == null ? 43 : var3.hashCode());
         String var4 = this.getChecksum();
         var2 = var2 * 59 + (var4 == null ? 43 : var4.hashCode());
         String var5 = this.getDescription();
         var2 = var2 * 59 + (var5 == null ? 43 : var5.hashCode());
         String var6 = this.getValueXml();
         var2 = var2 * 59 + (var6 == null ? 43 : var6.hashCode());
         String var7 = this.getEntityClassName();
         var2 = var2 * 59 + (var7 == null ? 43 : var7.hashCode());
         JsonNode var8 = this.getValueJson();
         return var2 * 59 + (var8 == null ? 43 : var8.hashCode());
      }

      static {
         String[] var5 = new String[7];
         int var3 = 0;
         String var2 = "\fpT\u001f7.Rj#M\u0010f\n\fpG\u0010:9[E4\u001f\u000b\fpT\u001f7.Rx=NC\u0012\fpG\u0010/2CY\u0013N\u001f((yA=GC\u000b\fpA\u0016>8\\S%OC";
         int var4 = "\fpT\u001f7.Rj#M\u0010f\n\fpG\u0010:9[E4\u001f\u000b\fpT\u001f7.Rx=NC\u0012\fpG\u0010/2CY\u0013N\u001f((yA=GC\u000b\fpA\u0016>8\\S%OC"
            .length();
         char var1 = '\f';
         int var7 = -1;

         label24:
         while (true) {
            byte var10000 = 115;
            String var10001 = var2.substring(++var7, var7 + var1);
            byte var10002 = -1;

            while (true) {
               String var8 = b(var10000, b(var10001));
               switch (var10002) {
                  case 0:
                     var5[var3++] = var8;
                     if ((var7 += var1) >= var4) {
                        n = var5;
                        return;
                     }

                     var1 = var2.charAt(var7);
                     break;
                  default:
                     var5[var3++] = var8;
                     if ((var7 += var1) < var4) {
                        var1 = var2.charAt(var7);
                        continue label24;
                     }

                     var2 = "Q\u0003z-\u001f\u0004bS\b`!\u0019\u0014EB):\u000f\b\u0003dd\u000fw\r\u0003\u0019hb\u001f]&\u001d\u0018u>\bu%\bP\u000e:Fp-\u001e\u000es\u007f\u0016`!\u0002\u0003<";
                     var4 = "Q\u0003z-\u001f\u0004bS\b`!\u0019\u0014EB):\u000f\b\u0003dd\u000fw\r\u0003\u0019hb\u001f]&\u001d\u0018u>\bu%\bP\u000e:Fp-\u001e\u000es\u007f\u0016`!\u0002\u0003<"
                        .length();
                     var1 = ')';
                     var7 = -1;
               }

               var10000 = 69;
               var10001 = var2.substring(++var7, var7 + var1);
               var10002 = 0;
            }
         }
      }

      private static char[] b(String var0) {
         char[] var10000 = var0.toCharArray();
         if (var10000.length < 2) {
            var10000[0] = (char)(var10000[0] ^ 68);
         }

         return var10000;
      }

      private static String b(int var0, char[] var1) {
         int var10003 = var1.length;
         int var10002 = var0;
         char[] var10001 = var1;
         int var10000 = var10003;

         for (int var2 = 0; var10000 > var2; var2++) {
            var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
               case 0 -> 83;
               case 1 -> 35;
               case 2 -> 81;
               case 3 -> 13;
               case 4 -> 40;
               case 5 -> 40;
               default -> 68;
            });
         }

         return new String(var10001).intern();
      }
   }

   @JsonIncludeProperties({"name", "enabled", "description", "valueXml", "entityClassName"})
   @JsonPropertyOrder({"name", "enabled", "description", "valueXml", "entityClassName"})
   public static class GenericEntityWrapper extends GenericEntityDTO {
      public GenericEntityWrapper(GenericEntity var1, GenericEntityHelper var2) {
         super(var1, var2);
      }

      @Override
      protected Object createWrapperObject() {
         return null;
      }
   }
}
