001package jmri.jmrit.logixng.tools.debugger;
002
003import java.util.Set;
004
005import javax.annotation.Nonnull;
006
007import jmri.JmriException;
008import jmri.NamedBean;
009import jmri.jmrit.logixng.BaseManager;
010import jmri.jmrit.logixng.MaleStringActionSocket;
011
012/**
013 *
014 * @author daniel
015 */
016public class DebuggerMaleStringActionSocket extends AbstractDebuggerMaleSocket implements MaleStringActionSocket {
017    
018    private String _nextValue;
019    
020    public DebuggerMaleStringActionSocket(BaseManager<MaleStringActionSocket> manager, MaleStringActionSocket maleSocket) {
021        super(manager, maleSocket);
022    }
023
024    /** {@inheritDoc} */
025    @Override
026    public String getBeforeInfo() {
027        return Bundle.getMessage("StringAction_InfoBefore", _nextValue);
028    }
029    
030    /** {@inheritDoc} */
031    @Override
032    public String getAfterInfo() {
033        return Bundle.getMessage("StringAction_InfoAfter");
034    }
035    
036    @Override
037    public void setValue(@Nonnull String value) throws JmriException {
038        _nextValue = value;
039        before();
040        ((MaleStringActionSocket)getObject()).setValue(_nextValue);
041        after();
042    }
043
044    @Override
045    public void setState(int s) throws JmriException {
046        ((MaleStringActionSocket)getObject()).setState(s);
047    }
048
049    @Override
050    public int getState() {
051        return ((MaleStringActionSocket)getObject()).getState();
052    }
053
054    @Override
055    public String describeState(int state) {
056        return ((MaleStringActionSocket)getObject()).describeState(state);
057    }
058
059    @Override
060    public void setProperty(String key, Object value) {
061        ((MaleStringActionSocket)getObject()).setProperty(key, value);
062    }
063
064    @Override
065    public Object getProperty(String key) {
066        return ((MaleStringActionSocket)getObject()).getProperty(key);
067    }
068
069    @Override
070    public void removeProperty(String key) {
071        ((MaleStringActionSocket)getObject()).removeProperty(key);
072    }
073
074    @Override
075    public Set<String> getPropertyKeys() {
076        return ((MaleStringActionSocket)getObject()).getPropertyKeys();
077    }
078
079    @Override
080    public String getBeanType() {
081        return ((MaleStringActionSocket)getObject()).getBeanType();
082    }
083
084    @Override
085    public int compareSystemNameSuffix(String suffix1, String suffix2, NamedBean n2) {
086        return ((MaleStringActionSocket)getObject()).compareSystemNameSuffix(suffix1, suffix2, n2);
087    }
088    
089}