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

com.github.dynamicextensionsalfresco.models.M2ModelResource Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.models;

import org.alfresco.repo.dictionary.M2Model;
import org.springframework.core.io.Resource;

/**
 * Wrapper for an M2Model and the resource it was loaded from.
 * This wrapper adds resource information for any interested {@link com.github.dynamicextensionsalfresco.models.ModelRegistrar}.
 *
 * @author Laurent Van der Linden
 */
public class M2ModelResource {
	private final Resource resource;
	private final M2Model m2Model;

	public M2ModelResource(Resource resource, M2Model m2Model) {
		this.resource = resource;
		this.m2Model = m2Model;
	}

	public Resource getResource() {
		return resource;
	}

	public M2Model getM2Model() {
		return m2Model;
	}

	public String getName() {
		return m2Model.getName();
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		M2ModelResource that = (M2ModelResource) o;

		return m2Model.equals(that.m2Model);

	}

	@Override
	public int hashCode() {
		return m2Model.hashCode();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy