All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdc.mf.checks.atts.cardinality.AbstractCardinalityUpperBoundMustBeOneOrUnbounded Maven / Gradle / Ivy

The newest version!
package cdc.mf.checks.atts.cardinality;

import java.util.List;

import cdc.issues.checks.SnapshotManager;
import cdc.issues.rules.Rule;
import cdc.mf.model.MfCardinality;
import cdc.mf.model.MfCardinalityItem;

/**
 * Check that if an {@link MfCardinalityItem} has a valid cardinality, its upper
 * bound is 1 or *.
 *
 * @author Damien Carbonne
 * @param  The {@link MfCardinalityItem} type.
 */
public abstract class AbstractCardinalityUpperBoundMustBeOneOrUnbounded
        extends AbstractCardinalityUpperBoundMustBeAmong {
    private static final List VALUES = List.of(1, MfCardinality.UNBOUNDED);

    protected static String describe(String article,
                                     String item) {
        return describe(article, item, VALUES);
    }

    protected AbstractCardinalityUpperBoundMustBeOneOrUnbounded(SnapshotManager manager,
                                                                Class objectClass,
                                                                Rule rule) {
        super(manager,
              objectClass,
              rule,
              VALUES);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy