// Path: src/main/java/org/fuin/ddd4j/ddd/Ddd4JUtils.java
// public static final String SHORT_ID_PREFIX = "DDD4J";


import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objects4j.vo.ValueObject;
import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;
import java.io.Serializable;
import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.ExceptionShortIdentifable;

/**
 * Copyright (C) 2015 Michael Schnell. All rights reserved. 
 * http://www.fuin.org/
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 3 of the License, or (at your option) any
 * later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library. If not, see http://www.gnu.org/licenses/.
 */
package org.fuin.ddd4j.ddd;





/**
 * Signals that the requested version for an aggregate does not exist.
 */
public final class AggregateVersionNotFoundException extends Exception
        implements ExceptionShortIdentifable, MarshalInformation<AggregateVersionNotFoundException.Data> {

    private static final long serialVersionUID = 1L;

    /** Unique short identifier of this exception. */
    public static final String SHORT_ID = SHORT_ID_PREFIX + "-AGGREGATE_VERSION_NOT_FOUND";

    /** Unique name of the element to use for XML and JSON marshalling/unmarshalling. */
    public static final String ELEMENT_NAME = "aggregate-version-not-found-exception";

    private final Data data;

    /**
     * Constructor with all data.
     * 
     * @param aggregateType
     *            Type of the aggregate.
     * @param aggregateId
     *            Unique identifier of the aggregate.
     * @param version
     *            Requested version.
     */
    public AggregateVersionNotFoundException(@NotNull final EntityType aggregateType, @NotNull final AggregateRootId aggregateId,

// Path: src/main/java/org/fuin/ddd4j/ddd/Ddd4JUtils.java
// public static final String SHORT_ID_PREFIX = "DDD4J";


// Path: src/main/java/org/fuin/ddd4j/ddd/AggregateVersionNotFoundException.java
import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objects4j.vo.ValueObject;
import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;
import java.io.Serializable;
import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.ExceptionShortIdentifable;

/**
 * Copyright (C) 2015 Michael Schnell. All rights reserved. 
 * http://www.fuin.org/
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 3 of the License, or (at your option) any
 * later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library. If not, see http://www.gnu.org/licenses/.
 */
package org.fuin.ddd4j.ddd;





/**
 * Signals that the requested version for an aggregate does not exist.
 */
public final class AggregateVersionNotFoundException extends Exception
        implements ExceptionShortIdentifable, MarshalInformation<AggregateVersionNotFoundException.Data> {

    private static final long serialVersionUID = 1L;

    /** Unique short identifier of this exception. */
    public static final String SHORT_ID = SHORT_ID_PREFIX + "-AGGREGATE_VERSION_NOT_FOUND";

    /** Unique name of the element to use for XML and JSON marshalling/unmarshalling. */
    public static final String ELEMENT_NAME = "aggregate-version-not-found-exception";

    private final Data data;

    /**
     * Constructor with all data.
     * 
     * @param aggregateType
     *            Type of the aggregate.
     * @param aggregateId
     *            Unique identifier of the aggregate.
     * @param version
     *            Requested version.
     */
    public AggregateVersionNotFoundException(@NotNull final EntityType aggregateType, @NotNull final AggregateRootId aggregateId,

            final int version) {
