import { assert } from "../../assert.js";
import MultiplicityType from "./MultiplicityType.js";

class Field {
    /**
     *
     * @param {String} name
     * @param {Type} type
     * @param {MultiplicityType} multiplicity
     * @constructor
     */
    constructor(name, type, multiplicity = MultiplicityType.One) {
        assert.equal(typeof name, "string", `Name must be of type "string", instead was "${typeof name}"`);

        this.name = name;
        this.type = type;
        this.multiplicity = multiplicity;
        this.initial = null;
        this.observed = true;
    }
}

export default Field;
