Coverage Report - org.kuali.student.common.assembly.helper.RuntimeDataHelper
 
Classes in this File Line Coverage Branch Coverage Complexity
RuntimeDataHelper
0%
0/19
0%
0/2
1.154
RuntimeDataHelper$Properties
0%
0/9
N/A
1.154
 
 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.common.assembly.helper;
 17  
 
 18  
 
 19  
 import org.kuali.student.common.assembly.data.Data;
 20  
 
 21  
 
 22  
 
 23  
 public class RuntimeDataHelper
 24  
 {
 25  
         private static final long serialVersionUID = 1;
 26  
         
 27  0
         public enum Properties implements PropertyEnum
 28  
         {
 29  0
                 CREATED ("created"),
 30  0
                 DELETED ("deleted"),
 31  0
                 UPDATED ("updated"),
 32  0
                 VERSIONS ("versions");
 33  
                 
 34  
                 private final String key;
 35  
                 
 36  
                 private Properties (final String key)
 37  0
                 {
 38  0
                         this.key = key;
 39  0
                 }
 40  
                 
 41  
                 @Override
 42  
                 public String getKey ()
 43  
                 {
 44  0
                         return this.key;
 45  
                 }
 46  
         }
 47  
         private Data data;
 48  
         
 49  
         private RuntimeDataHelper (Data data)
 50  0
         {
 51  0
                 this.data = data;
 52  0
         }
 53  
         
 54  
         public static RuntimeDataHelper wrap (Data data)
 55  
         {
 56  0
                 if (data == null)
 57  
                 {
 58  0
                          return null;
 59  
                 }
 60  0
                 return new RuntimeDataHelper (data);
 61  
         }
 62  
         
 63  
         public Data getData ()
 64  
         {
 65  0
                 return data;
 66  
         }
 67  
         
 68  
         
 69  
         public void setCreated (Boolean value)
 70  
         {
 71  0
                 data.set (Properties.CREATED.getKey (), value);
 72  0
         }
 73  
         
 74  
         
 75  
         public Boolean isCreated ()
 76  
         {
 77  0
                 return (Boolean) data.get (Properties.CREATED.getKey ());
 78  
         }
 79  
         
 80  
         
 81  
         public void setDeleted (Boolean value)
 82  
         {
 83  0
                 data.set (Properties.DELETED.getKey (), value);
 84  0
         }
 85  
         
 86  
         
 87  
         public Boolean isDeleted ()
 88  
         {
 89  0
                 return (Boolean) data.get (Properties.DELETED.getKey ());
 90  
         }
 91  
         
 92  
         
 93  
         public void setUpdated (Boolean value)
 94  
         {
 95  0
                 data.set (Properties.UPDATED.getKey (), value);
 96  0
         }
 97  
         
 98  
         
 99  
         public Boolean isUpdated ()
 100  
         {
 101  0
                 return (Boolean) data.get (Properties.UPDATED.getKey ());
 102  
         }
 103  
         
 104  
         
 105  
         public void setVersions (Data value)
 106  
         {
 107  0
                 data.set (Properties.VERSIONS.getKey (), value);
 108  0
         }
 109  
         
 110  
         
 111  
         public Data getVersions ()
 112  
         {
 113  0
                 return (Data) data.get (Properties.VERSIONS.getKey ());
 114  
         }
 115  
         
 116  
 }
 117