View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.r1.common.assembly.helper;
17  
18  
19  import org.kuali.student.r1.common.assembly.data.Data;
20  
21  
22  
23  @Deprecated
24  public class RuntimeDataHelper
25  {
26  	private static final long serialVersionUID = 1;
27  	
28  	public enum Properties implements PropertyEnum
29  	{
30  		CREATED ("created"),
31  		DELETED ("deleted"),
32  		UPDATED ("updated"),
33  		VERSIONS ("versions");
34  		
35  		private final String key;
36  		
37  		private Properties (final String key)
38  		{
39  			this.key = key;
40  		}
41  		
42  		@Override
43  		public String getKey ()
44  		{
45  			return this.key;
46  		}
47  	}
48  	private Data data;
49  	
50  	private RuntimeDataHelper (Data data)
51  	{
52  		this.data = data;
53  	}
54  	
55  	public static RuntimeDataHelper wrap (Data data)
56  	{
57  		if (data == null)
58  		{
59  			 return null;
60  		}
61  		return new RuntimeDataHelper (data);
62  	}
63  	
64  	public Data getData ()
65  	{
66  		return data;
67  	}
68  	
69  	
70  	public void setCreated (Boolean value)
71  	{
72  		data.set (Properties.CREATED.getKey (), value);
73  	}
74  	
75  	
76  	public Boolean isCreated ()
77  	{
78  		return (Boolean) data.get (Properties.CREATED.getKey ());
79  	}
80  	
81  	
82  	public void setDeleted (Boolean value)
83  	{
84  		data.set (Properties.DELETED.getKey (), value);
85  	}
86  	
87  	
88  	public Boolean isDeleted ()
89  	{
90  		return (Boolean) data.get (Properties.DELETED.getKey ());
91  	}
92  	
93  	
94  	public void setUpdated (Boolean value)
95  	{
96  		data.set (Properties.UPDATED.getKey (), value);
97  	}
98  	
99  	
100 	public Boolean isUpdated ()
101 	{
102 		return (Boolean) data.get (Properties.UPDATED.getKey ());
103 	}
104 	
105 	
106 	public void setVersions (Data value)
107 	{
108 		data.set (Properties.VERSIONS.getKey (), value);
109 	}
110 	
111 	
112 	public Data getVersions ()
113 	{
114 		return (Data) data.get (Properties.VERSIONS.getKey ());
115 	}
116 	
117 }
118