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

net.lamberto.configuration.ConfigurationOptionImpl Maven / Gradle / Ivy

Go to download

A Guice module using Apache Commons Configuration for mapping named properties by using a type-based injection.

There is a newer version: 1.0.1
Show newest version
package net.lamberto.configuration;

import java.io.Serializable;
import java.lang.annotation.Annotation;

// NOTE: quick way for suppressing "The annotation type ConfigurationOption should not be used as a superinterface for ConfigurationOptionImpl" warning
@SuppressWarnings("all")
class ConfigurationOptionImpl implements ConfigurationOption, Serializable {
	private static final long serialVersionUID = 1L;

	private final Class> value;

	public ConfigurationOptionImpl(final Class> value) {
		this.value = value;
	}

	@Override
	public Class> value() {
		return value;
	}

	@Override
	public int hashCode() {
		// This is specified in java.lang.Annotation.
		return (127 * "value".hashCode()) ^ value.hashCode();
	}

	@Override
	public boolean equals(final Object o) {
		if (!(o instanceof ConfigurationOption)) {
			return false;
		}

		final ConfigurationOption other = (ConfigurationOption) o;
		return value.equals(other.value());
	}

	@Override
	public String toString() {
		return "@" + ConfigurationOption.class.getName() + "(value=" + value + ")";
	}

	@Override
	public Class annotationType() {
		return ConfigurationOption.class;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy