package org.glassfish.jersey.model.internal;
import java.util.Map;
import javax.ws.rs.core.Configuration;
import org.glassfish.jersey.internal.LocalizationMessages;
public class ImmutableCommonConfig extends CommonConfig {
private final String errorMessage;
public ImmutableCommonConfig(final CommonConfig config, final String modificationErrorMessage) {
super(config);
this.errorMessage = modificationErrorMessage;
}
public ImmutableCommonConfig(final CommonConfig config) {
this(config, LocalizationMessages.CONFIGURATION_NOT_MODIFIABLE());
}
@Override
public ImmutableCommonConfig property(String name, Object value) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig setProperties(final Map<String, ?> properties) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig register(final Class<?> componentClass) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig register(final Class<?> componentClass, final int bindingPriority) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig register(final Class<?> componentClass, final Class<?>... contracts) {
throw new IllegalStateException(errorMessage);
}
@Override
public CommonConfig register(Class<?> componentClass, Map<Class<?>, Integer> contracts) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig register(final Object component) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig register(final Object component, final int bindingPriority) {
throw new IllegalStateException(errorMessage);
}
@Override
public ImmutableCommonConfig register(final Object component, final Class<?>... contracts) {
throw new IllegalStateException(errorMessage);
}
@Override
public CommonConfig register(Object component, Map<Class<?>, Integer> contracts) {
throw new IllegalStateException(errorMessage);
}
@Override
public CommonConfig loadFrom(Configuration config) {
throw new IllegalStateException(errorMessage);
}
}