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

org.fiolino.common.processing.AbstractModelDescriptionContainer Maven / Gradle / Ivy

Go to download

General structure to easily create dynamic logic via MethodHandles and others.

There is a newer version: 1.0.10
Show newest version
package org.fiolino.common.processing;

import org.fiolino.common.container.Container;

/**
 * Created by kuli on 25.11.15.
 */
public abstract class AbstractModelDescriptionContainer implements ModelDescriptionContainer, ConfigurationContainer {

    private final ModelDescription modelDescription;

    protected AbstractModelDescriptionContainer(ModelDescription modelDescription) {
        this.modelDescription = modelDescription;
    }

    @Override
    public final ModelDescription getModelDescription() {
        return modelDescription;
    }

    @Override
    public final Container getConfiguration() {
        return getModelDescription().getConfiguration();
    }

    @Override
    public String toString() {
        return getClass().getName() + " for " + modelDescription;
    }

    @Override
    public boolean equals(Object obj) {
        return obj != null && obj.getClass().equals(getClass())
                && modelDescription.equals(((ModelDescriptionContainer) obj).getModelDescription());
    }

    @Override
    public int hashCode() {
        return modelDescription.hashCode() * 31 + getClass().hashCode();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy