001package org.javasimon;
002
003/**
004 * Stores configuration for the particular Simon or the set of Simons.
005 * Currently it holds only the state of the Simon.
006 *
007 * @author <a href="mailto:virgo47@gmail.com">Richard "Virgo" Richter</a>
008 */
009public final class SimonConfiguration {
010        private SimonState state;
011
012        /**
013         * Creates SimonConfiguration item.
014         *
015         * @param state preferred state - SimonManager sets inherit if null is specified here
016         */
017        SimonConfiguration(SimonState state) {
018                this.state = state;
019        }
020
021        /**
022         * Returns Simon state for this configuration item.
023         *
024         * @return configured Simon state or null if nothing was specified
025         */
026        public SimonState getState() {
027                return state;
028        }
029
030        /**
031         * Returns configuration information about Simon (stat processor type and state) as a human readable string.
032         *
033         * @return configuration information about Simon as string
034         */
035        @Override
036        public String toString() {
037                return "SimonConfiguration {\n" +
038                        "  state=" + state + "\n" +
039                        "}";
040        }
041}