content: /*
   * Legal Entity Management API
   *
   * The version of the OpenAPI document: 4
   *
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  package com.adyen.model.legalentitymanagement;
  
  import com.fasterxml.jackson.core.JsonGenerator;
  import com.fasterxml.jackson.core.JsonParser;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import com.fasterxml.jackson.core.JsonToken;
  import com.fasterxml.jackson.databind.DeserializationContext;
  import com.fasterxml.jackson.databind.JsonMappingException;
  import com.fasterxml.jackson.databind.JsonNode;
  import com.fasterxml.jackson.databind.MapperFeature;
  import com.fasterxml.jackson.databind.SerializerProvider;
  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
  import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
  import com.fasterxml.jackson.databind.ser.std.StdSerializer;
  import jakarta.ws.rs.core.GenericType;
  import java.io.IOException;
  import java.util.*;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  @JsonDeserialize(
      using =
          BankAccountInfoAccountIdentification.BankAccountInfoAccountIdentificationDeserializer.class)
  @JsonSerialize(
      using =
          BankAccountInfoAccountIdentification.BankAccountInfoAccountIdentificationSerializer.class)
  public class BankAccountInfoAccountIdentification extends AbstractOpenApiSchema {
    private static final Logger log =
        Logger.getLogger(BankAccountInfoAccountIdentification.class.getName());
  
    public static class BankAccountInfoAccountIdentificationSerializer
        extends StdSerializer<BankAccountInfoAccountIdentification> {
      public BankAccountInfoAccountIdentificationSerializer(
          Class<BankAccountInfoAccountIdentification> t) {
        super(t);
      }
  
      public BankAccountInfoAccountIdentificationSerializer() {
        this(null);
      }
  
      @Override
      public void serialize(
          BankAccountInfoAccountIdentification value, JsonGenerator jgen, SerializerProvider provider)
          throws IOException, JsonProcessingException {
        jgen.writeObject(value.getActualInstance());
      }
    }
  
    public static class BankAccountInfoAccountIdentificationDeserializer
        extends StdDeserializer<BankAccountInfoAccountIdentification> {
      public BankAccountInfoAccountIdentificationDeserializer() {
        this(BankAccountInfoAccountIdentification.class);
      }
  
      public BankAccountInfoAccountIdentificationDeserializer(Class<?> vc) {
        super(vc);
      }
  
      @Override
      public BankAccountInfoAccountIdentification deserialize(
          JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        JsonNode tree = jp.readValueAsTree();
        Object deserialized = null;
        boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
        int match = 0;
        JsonToken token = tree.traverse(jp.getCodec()).nextToken();
        // deserialize AULocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(AULocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(AULocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'AULocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'AULocalAccountIdentification'", e);
        }
  
        // deserialize CALocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(CALocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(CALocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'CALocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'CALocalAccountIdentification'", e);
        }
  
        // deserialize CZLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(CZLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(CZLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'CZLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'CZLocalAccountIdentification'", e);
        }
  
        // deserialize DKLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(DKLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(DKLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'DKLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'DKLocalAccountIdentification'", e);
        }
  
        // deserialize HKLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(HKLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(HKLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'HKLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'HKLocalAccountIdentification'", e);
        }
  
        // deserialize HULocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(HULocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(HULocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'HULocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'HULocalAccountIdentification'", e);
        }
  
        // deserialize IbanAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(IbanAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(IbanAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'IbanAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'IbanAccountIdentification'", e);
        }
  
        // deserialize NOLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(NOLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(NOLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'NOLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'NOLocalAccountIdentification'", e);
        }
  
        // deserialize NZLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(NZLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(NZLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'NZLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'NZLocalAccountIdentification'", e);
        }
  
        // deserialize NumberAndBicAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(NumberAndBicAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(NumberAndBicAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'NumberAndBicAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(
              Level.FINER, "Input data does not match schema 'NumberAndBicAccountIdentification'", e);
        }
  
        // deserialize PLLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(PLLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(PLLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'PLLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'PLLocalAccountIdentification'", e);
        }
  
        // deserialize SELocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(SELocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(SELocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'SELocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'SELocalAccountIdentification'", e);
        }
  
        // deserialize SGLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(SGLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(SGLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'SGLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'SGLocalAccountIdentification'", e);
        }
  
        // deserialize UKLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(UKLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(UKLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'UKLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'UKLocalAccountIdentification'", e);
        }
  
        // deserialize USLocalAccountIdentification
        try {
          boolean attemptParsing = true;
          if (attemptParsing) {
            // Checks if the unique type of the oneOf json matches any of the object TypeEnum values
            boolean typeMatch = false;
            if (tree.findValue("type") != null) {
              typeMatch =
                  Arrays.stream(USLocalAccountIdentification.TypeEnum.values())
                      .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));
            }
  
            if (typeMatch) {
              deserialized =
                  tree.traverse(jp.getCodec()).readValueAs(USLocalAccountIdentification.class);
              // TODO: there is no validation against JSON schema constraints
              // (min, max, enum, pattern...), this does not perform a strict JSON
              // validation, which means the 'match' count may be higher than it should be.
              match++;
              log.log(Level.FINER, "Input data matches schema 'USLocalAccountIdentification'");
            }
          }
        } catch (Exception e) {
          // deserialization failed, continue
          log.log(Level.FINER, "Input data does not match schema 'USLocalAccountIdentification'", e);
        }
  
        if (match == 1) {
          BankAccountInfoAccountIdentification ret = new BankAccountInfoAccountIdentification();
          ret.setActualInstance(deserialized);
          return ret;
        }
        throw new IOException(
            String.format(
                "Failed deserialization for BankAccountInfoAccountIdentification: %d classes match result, expected 1",
                match));
      }
  
      /** Handle deserialization of the 'null' value. */
      @Override
      public BankAccountInfoAccountIdentification getNullValue(DeserializationContext ctxt)
          throws JsonMappingException {
        throw new JsonMappingException(
            ctxt.getParser(), "BankAccountInfoAccountIdentification cannot be null");
      }
    }
  
    // store a list of schema names defined in oneOf
    public static final Map<String, GenericType<?>> schemas = new HashMap<>();
  
    public BankAccountInfoAccountIdentification() {
      super("oneOf", Boolean.FALSE);
    }
  
    public BankAccountInfoAccountIdentification(AULocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(CALocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(CZLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(DKLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(HKLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(HULocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(IbanAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(NOLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(NZLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(NumberAndBicAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(PLLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(SELocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(SGLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(UKLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    public BankAccountInfoAccountIdentification(USLocalAccountIdentification o) {
      super("oneOf", Boolean.FALSE);
      setActualInstance(o);
    }
  
    static {
      schemas.put("AULocalAccountIdentification", new GenericType<AULocalAccountIdentification>() {});
      schemas.put("CALocalAccountIdentification", new GenericType<CALocalAccountIdentification>() {});
      schemas.put("CZLocalAccountIdentification", new GenericType<CZLocalAccountIdentification>() {});
      schemas.put("DKLocalAccountIdentification", new GenericType<DKLocalAccountIdentification>() {});
      schemas.put("HKLocalAccountIdentification", new GenericType<HKLocalAccountIdentification>() {});
      schemas.put("HULocalAccountIdentification", new GenericType<HULocalAccountIdentification>() {});
      schemas.put("IbanAccountIdentification", new GenericType<IbanAccountIdentification>() {});
      schemas.put("NOLocalAccountIdentification", new GenericType<NOLocalAccountIdentification>() {});
      schemas.put("NZLocalAccountIdentification", new GenericType<NZLocalAccountIdentification>() {});
      schemas.put(
          "NumberAndBicAccountIdentification",
          new GenericType<NumberAndBicAccountIdentification>() {});
      schemas.put("PLLocalAccountIdentification", new GenericType<PLLocalAccountIdentification>() {});
      schemas.put("SELocalAccountIdentification", new GenericType<SELocalAccountIdentification>() {});
      schemas.put("SGLocalAccountIdentification", new GenericType<SGLocalAccountIdentification>() {});
      schemas.put("UKLocalAccountIdentification", new GenericType<UKLocalAccountIdentification>() {});
      schemas.put("USLocalAccountIdentification", new GenericType<USLocalAccountIdentification>() {});
      JSON.registerDescendants(
          BankAccountInfoAccountIdentification.class, Collections.unmodifiableMap(schemas));
    }
  
    @Override
    public Map<String, GenericType<?>> getSchemas() {
      return BankAccountInfoAccountIdentification.schemas;
    }
  
    /**
     * Set the instance that matches the oneOf child schema, check the instance parameter is valid
     * against the oneOf child schemas: AULocalAccountIdentification, CALocalAccountIdentification,
     * CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification,
     * HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification,
     * NZLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification,
     * SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification,
     * USLocalAccountIdentification
     *
     * <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
     * composed schema (allOf, anyOf, oneOf).
     */
    @Override
    public void setActualInstance(Object instance) {
      if (JSON.isInstanceOf(AULocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(CALocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(CZLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(DKLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(HKLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(HULocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(IbanAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(NOLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(NZLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(NumberAndBicAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(PLLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(SELocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(SGLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(UKLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      if (JSON.isInstanceOf(USLocalAccountIdentification.class, instance, new HashSet<>())) {
        super.setActualInstance(instance);
        return;
      }
  
      throw new RuntimeException(
          "Invalid instance type. Must be AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NZLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification");
    }
  
    /**
     * Get the actual instance, which can be the following: AULocalAccountIdentification,
     * CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification,
     * HKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification,
     * NOLocalAccountIdentification, NZLocalAccountIdentification, NumberAndBicAccountIdentification,
     * PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification,
     * UKLocalAccountIdentification, USLocalAccountIdentification
     *
     * @return The actual instance (AULocalAccountIdentification, CALocalAccountIdentification,
     *     CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification,
     *     HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification,
     *     NZLocalAccountIdentification, NumberAndBicAccountIdentification,
     *     PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification,
     *     UKLocalAccountIdentification, USLocalAccountIdentification)
     */
    @Override
    public Object getActualInstance() {
      return super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `AULocalAccountIdentification`. If the actual instance is not
     * `AULocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `AULocalAccountIdentification`
     * @throws ClassCastException if the instance is not `AULocalAccountIdentification`
     */
    public AULocalAccountIdentification getAULocalAccountIdentification() throws ClassCastException {
      return (AULocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `CALocalAccountIdentification`. If the actual instance is not
     * `CALocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `CALocalAccountIdentification`
     * @throws ClassCastException if the instance is not `CALocalAccountIdentification`
     */
    public CALocalAccountIdentification getCALocalAccountIdentification() throws ClassCastException {
      return (CALocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `CZLocalAccountIdentification`. If the actual instance is not
     * `CZLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `CZLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `CZLocalAccountIdentification`
     */
    public CZLocalAccountIdentification getCZLocalAccountIdentification() throws ClassCastException {
      return (CZLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `DKLocalAccountIdentification`. If the actual instance is not
     * `DKLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `DKLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `DKLocalAccountIdentification`
     */
    public DKLocalAccountIdentification getDKLocalAccountIdentification() throws ClassCastException {
      return (DKLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `HKLocalAccountIdentification`. If the actual instance is not
     * `HKLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `HKLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `HKLocalAccountIdentification`
     */
    public HKLocalAccountIdentification getHKLocalAccountIdentification() throws ClassCastException {
      return (HKLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `HULocalAccountIdentification`. If the actual instance is not
     * `HULocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `HULocalAccountIdentification`
     * @throws ClassCastException if the instance is not `HULocalAccountIdentification`
     */
    public HULocalAccountIdentification getHULocalAccountIdentification() throws ClassCastException {
      return (HULocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `IbanAccountIdentification`. If the actual instance is not
     * `IbanAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `IbanAccountIdentification`
     * @throws ClassCastException if the instance is not `IbanAccountIdentification`
     */
    public IbanAccountIdentification getIbanAccountIdentification() throws ClassCastException {
      return (IbanAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `NOLocalAccountIdentification`. If the actual instance is not
     * `NOLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `NOLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `NOLocalAccountIdentification`
     */
    public NOLocalAccountIdentification getNOLocalAccountIdentification() throws ClassCastException {
      return (NOLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `NZLocalAccountIdentification`. If the actual instance is not
     * `NZLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `NZLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `NZLocalAccountIdentification`
     */
    public NZLocalAccountIdentification getNZLocalAccountIdentification() throws ClassCastException {
      return (NZLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `NumberAndBicAccountIdentification`. If the actual instance is not
     * `NumberAndBicAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `NumberAndBicAccountIdentification`
     * @throws ClassCastException if the instance is not `NumberAndBicAccountIdentification`
     */
    public NumberAndBicAccountIdentification getNumberAndBicAccountIdentification()
        throws ClassCastException {
      return (NumberAndBicAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `PLLocalAccountIdentification`. If the actual instance is not
     * `PLLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `PLLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `PLLocalAccountIdentification`
     */
    public PLLocalAccountIdentification getPLLocalAccountIdentification() throws ClassCastException {
      return (PLLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `SELocalAccountIdentification`. If the actual instance is not
     * `SELocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `SELocalAccountIdentification`
     * @throws ClassCastException if the instance is not `SELocalAccountIdentification`
     */
    public SELocalAccountIdentification getSELocalAccountIdentification() throws ClassCastException {
      return (SELocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `SGLocalAccountIdentification`. If the actual instance is not
     * `SGLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `SGLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `SGLocalAccountIdentification`
     */
    public SGLocalAccountIdentification getSGLocalAccountIdentification() throws ClassCastException {
      return (SGLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `UKLocalAccountIdentification`. If the actual instance is not
     * `UKLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `UKLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `UKLocalAccountIdentification`
     */
    public UKLocalAccountIdentification getUKLocalAccountIdentification() throws ClassCastException {
      return (UKLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Get the actual instance of `USLocalAccountIdentification`. If the actual instance is not
     * `USLocalAccountIdentification`, the ClassCastException will be thrown.
     *
     * @return The actual instance of `USLocalAccountIdentification`
     * @throws ClassCastException if the instance is not `USLocalAccountIdentification`
     */
    public USLocalAccountIdentification getUSLocalAccountIdentification() throws ClassCastException {
      return (USLocalAccountIdentification) super.getActualInstance();
    }
  
    /**
     * Create an instance of BankAccountInfoAccountIdentification given an JSON string
     *
     * @param jsonString JSON string
     * @return An instance of BankAccountInfoAccountIdentification
     * @throws IOException if the JSON string is invalid with respect to
     *     BankAccountInfoAccountIdentification
     */
    public static BankAccountInfoAccountIdentification fromJson(String jsonString)
        throws IOException {
      return JSON.getMapper().readValue(jsonString, BankAccountInfoAccountIdentification.class);
    }
  
    /**
     * Convert an instance of BankAccountInfoAccountIdentification to an JSON string
     *
     * @return JSON string
     */
    public String toJson() throws JsonProcessingException {
      return JSON.getMapper().writeValueAsString(this);
    }
  }
  