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

org.springframework.contributions.ordered.OrderedContribution Maven / Gradle / Ivy

Go to download

This project adds a so called contribution mechanism (like known from Tapestry IOC or Eclipse Plugins) for configuration and extension of services to the Spring project.

There is a newer version: 2.0.0
Show newest version
package org.springframework.contributions.ordered;

import java.util.Arrays;

import org.springframework.contributions.util.Orderable;

/**
 * Holder class for ordered contribution.
 *
 * @author Christian Köberl
 */
public class OrderedContribution implements Orderable
{
	private final String beanName;

	private final Object beanValueOrReference;

	private final String[] constraints;

	/**
	 * Create ordered contribution.
	 * 
	 * @param beanName the bean name
	 * @param beanValueOrReference the Spring reference or value
	 * @param constraints ordering constraints separated via ","
	 */
	public OrderedContribution(final String beanName, final Object beanValueOrReference,
		final String... constraints)
	{
		super();

		this.beanName = beanName;
		this.beanValueOrReference = beanValueOrReference;
		this.constraints = constraints;
	}

	public String getBeanName()
	{
		return beanName;
	}

	public Object getBeanValueOrReference()
	{
		return beanValueOrReference;
	}

	/**
	 * {@inheritDoc}
	 */
	public String getOrderableId()
	{
		return beanName;
	}

	/**
	 * {@inheritDoc}
	 */
	public String[] getOrderableConstraints()
	{
		return constraints;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString()
	{
		return "OrderedContribution [beanName=" + beanName + ", constraints=" + Arrays.toString(constraints) + "]";
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy