package lc.esp.eo.sdk.schema;

import java.util.HashMap;

/**
 * This class implements a descriptive schema for an entire model, consisting of multiple typed objects.
 *
 * @author Alex Leigh
 * @since mk20 (TOKYO PROTOCOL)
 */
public class Model {
    private final HashMap<String, ObjectSchema> objSchemas = new HashMap<>();
    private final HashMap<String, AssociationSchema> assocSchemas = new HashMap<>();

    public void putSchema(ObjectSchema objSchema) {
        objSchemas.put(objSchema.getType(), objSchema);
    }

    public ObjectSchema getObjectSchema(String type) {
        return objSchemas.get(type);
    }

    public void putAssociation(AssociationSchema assocSchema) {
        assocSchemas.put(assocSchema.getType(), assocSchema);
    }

    public AssociationSchema getAssocSchema(String type) {
        return assocSchemas.get(type);
    }
}
