01: /* DataValueBean.java
02: *
03: * DDSteps - Data Driven JUnit Test Steps
04: * Copyright (C) 2005 Jayway AB
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License version 2.1 as published by the Free Software Foundation.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, visit
17: * http://www.opensource.org/licenses/lgpl-license.php
18: */
19: package org.ddsteps.dataset.bean;
20:
21: import org.apache.commons.lang.Validate;
22: import org.ddsteps.dataset.DataValue;
23:
24: /**
25: * Immutable bean.
26: *
27: * @author Adam
28: * @version $Id: DataValueBean.java,v 1.1 2005/12/03 12:51:40 adamskogman Exp $
29: */
30: public class DataValueBean implements DataValue {
31:
32: private final String name;
33:
34: private final Object value;
35:
36: /**
37: * Create bean.
38: *
39: * @param name
40: * The name, not null.
41: * @param value
42: * The value, may be null.
43: */
44: public DataValueBean(final String name, final Object value) {
45: super ();
46: Validate.notNull(name);
47:
48: this .name = name;
49: this .value = value;
50: }
51:
52: /**
53: * @see org.ddsteps.dataset.DataValue#getName()
54: */
55: public String getName() {
56: return name;
57: }
58:
59: /**
60: * @see org.ddsteps.dataset.DataValue#getValue()
61: */
62: public Object getValue() {
63: return value;
64: }
65:
66: }
|