package com.l7tech.gateway.api;

import com.l7tech.gateway.api.impl.AttributeExtensibleType;
import com.l7tech.gateway.api.impl.ElementExtensionSupport;
import com.l7tech.gateway.api.impl.PropertiesMapType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Map;

@XmlType(
   name = "JMSDestinationDetailType",
   propOrder = {"nameValue", "destinationNameValue", "inboundValue", "enabledValue", "templateValue", "properties", "extension", "extensions"}
)
public class JMSDestinationDetail extends ElementExtensionSupport {
   public static final String TYPE_QUEUE;
   public static final String TYPE_TOPIC;
   private String d;
   private Integer e;
   private AttributeExtensibleType.AttributeExtensibleString f;
   private AttributeExtensibleType.AttributeExtensibleString g;
   private AttributeExtensibleType.AttributeExtensibleBoolean h = new AttributeExtensibleType.AttributeExtensibleBoolean(false);
   private AttributeExtensibleType.AttributeExtensibleBoolean i = new AttributeExtensibleType.AttributeExtensibleBoolean(false);
   private AttributeExtensibleType.AttributeExtensibleBoolean j;
   private Map<String, Object> k;

   @XmlAttribute(name = "id")
   public String getId() {
      return this.d;
   }

   public void setId(String var1) {
      this.d = var1;
   }

   @XmlAttribute(name = "version")
   public Integer getVersion() {
      return this.e;
   }

   public void setVersion(Integer var1) {
      this.e = var1;
   }

   public String getName() {
      return AttributeExtensibleType.get(this.f);
   }

   public void setName(String var1) {
      this.f = AttributeExtensibleType.set(this.f, var1);
   }

   public String getDestinationName() {
      return AttributeExtensibleType.get(this.g);
   }

   public void setDestinationName(String var1) {
      this.g = AttributeExtensibleType.set(this.g, var1);
   }

   public boolean isInbound() {
      return AttributeExtensibleType.get(this.h, false);
   }

   public void setInbound(boolean var1) {
      this.h = AttributeExtensibleType.set(this.h, var1);
   }

   public boolean isEnabled() {
      return AttributeExtensibleType.get(this.i, false);
   }

   public void setEnabled(boolean var1) {
      this.i = AttributeExtensibleType.set(this.i, var1);
   }

   public Boolean isTemplate() {
      return AttributeExtensibleType.get(this.j);
   }

   public void setTemplate(Boolean var1) {
      this.j = AttributeExtensibleType.set(this.j, var1);
   }

   @XmlElement(name = "Properties")
   @XmlJavaTypeAdapter(PropertiesMapType.PropertiesMapTypeAdapter.class)
   public Map<String, Object> getProperties() {
      return this.k;
   }

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

   @XmlElement(name = "Name", required = true)
   protected AttributeExtensibleType.AttributeExtensibleString getNameValue() {
      return this.f;
   }

   protected void setNameValue(AttributeExtensibleType.AttributeExtensibleString var1) {
      this.f = var1;
   }

   @XmlElement(name = "DestinationName")
   protected AttributeExtensibleType.AttributeExtensibleString getDestinationNameValue() {
      return this.g;
   }

   protected void setDestinationNameValue(AttributeExtensibleType.AttributeExtensibleString var1) {
      this.g = var1;
   }

   @XmlElement(name = "Inbound", required = true)
   protected AttributeExtensibleType.AttributeExtensibleBoolean getInboundValue() {
      return this.h;
   }

   protected void setInboundValue(AttributeExtensibleType.AttributeExtensibleBoolean var1) {
      this.h = var1;
   }

   @XmlElement(name = "Enabled", required = true)
   protected AttributeExtensibleType.AttributeExtensibleBoolean getEnabledValue() {
      return this.i;
   }

   protected void setEnabledValue(AttributeExtensibleType.AttributeExtensibleBoolean var1) {
      this.i = var1;
   }

   @XmlElement(name = "Template")
   protected AttributeExtensibleType.AttributeExtensibleBoolean getTemplateValue() {
      return this.j;
   }

   protected void setTemplateValue(AttributeExtensibleType.AttributeExtensibleBoolean var1) {
      this.j = var1;
   }

   JMSDestinationDetail() {
   }

   static {
      String[] var0 = new String[2];
      int var4 = 0;
      String var3 = ")4ug\u0004\u0005,.`{\u0002";
      int var5 = ")4ug\u0004\u0005,.`{\u0002".length();
      char var2 = 5;
      int var1 = -1;

      while (true) {
         String var10002 = b(b(var3.substring(++var1, var1 + var2)));
         byte var10001 = -1;
         var0[var4++] = var10002;
         if ((var1 += var2) >= var5) {
            TYPE_QUEUE = var0[0];
            TYPE_TOPIC = var0[1];
            return;
         }

         var2 = var3.charAt(var1);
      }
   }

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

      return var10000;
   }

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

      for (int var1 = 0; var10000 > var1; var1++) {
         var10001[var1] = (char)(var10001[var1] ^ switch (var1 % 7) {
            case 0 -> 120;
            case 1 -> 65;
            case 2 -> 16;
            case 3 -> 18;
            case 4 -> 97;
            case 5 -> 8;
            default -> 10;
         });
      }

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