package com.plexobject.aom;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class EntityType {

    private String typeName;
    private Map<String, PropertyType> propertyTypes = new HashMap<String, PropertyType>();
    private Map<String, Operation> operations = new HashMap<String, Operation>();

    public EntityType(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeName() {
        return typeName;
    }

    public void addPropertyType(PropertyType propertyType) {
        propertyTypes.put(propertyType.getPropertyName(),
                propertyType);
    }

    public Collection<PropertyType> getPropertyTypes() {
        return propertyTypes.values();
    }

    public PropertyType getPropertyType(String propertyName) {
        return propertyTypes.get(propertyName);
    }

    public void addOperation(String operationName, Operation operation) {
        operations.put(operationName, operation);

    }

    public Operation getOperation(String name) {
        return operations.get(name);
    }

    public Collection<Operation> getOperations() {
        return operations.values();
    }
    //... other methods
}

