/** * Registers the given state with REGISTRY. * * @param state state to be registered. * * @throws IllegalArgumentException if the given state is already registered. */ public void register(SchemaVersionLifecycleState state) { checkForInbuiltStateIds(state); SchemaVersionLifecycleState prevState = states.putIfAbsent(state.getId(), state); if (prevState != null) { throw new IllegalArgumentException("Given state is already registered as " + prevState); } }
/** * Registers the given state with REGISTRY. * * @param state state to be registered. * * @throws IllegalArgumentException if the given state is already registered. */ public void register(SchemaVersionLifecycleState state) { checkForInbuiltStateIds(state); SchemaVersionLifecycleState prevState = states.putIfAbsent(state.getId(), state); if (prevState != null) { throw new IllegalArgumentException("Given state is already registered as " + prevState); } }