01: /*****************************************************************************
02: * Copyright (C) NanoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: * Original code by Mike Hogan *
09: *****************************************************************************/package org.nanocontainer.testmodel;
10:
11: import java.util.ArrayList;
12: import java.util.Collection;
13:
14: public class MockComponentImpl implements MockComponent {
15: private int port = 0;
16: private String server = null;
17: private Collection registers = new ArrayList();
18:
19: public int getPort() {
20: return port;
21: }
22:
23: public void setPort(int port) {
24: this .port = port;
25: }
26:
27: public String getServer() {
28: return server;
29: }
30:
31: public void setServer(String server) {
32: this .server = server;
33: }
34:
35: public void addRegister(Integer i) {
36: registers.add(i);
37: }
38:
39: public int getNumRegisters() {
40: return registers.size();
41: }
42:
43: public boolean hasRegister(int i) {
44: return registers.contains(new Integer(i));
45: }
46: }
|