| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| NamespaceEbo |
|
| 0.0;0 |
| 1 | /* | |
| 2 | * Copyright 2006-2011 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl2.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | package org.kuali.rice.core.framework.namespace | |
| 18 | ||
| 19 | import org.kuali.rice.core.api.namespace.Namespace | |
| 20 | import org.kuali.rice.core.api.namespace.NamespaceContract | |
| 21 | import org.kuali.rice.kns.bo.ExternalizableBusinessObject | |
| 22 | import org.kuali.rice.kns.bo.Inactivateable | |
| 23 | ||
| 24 | //@ToString | |
| 25 | class NamespaceEbo implements NamespaceContract, Inactivateable, ExternalizableBusinessObject { | |
| 26 | ||
| 27 | private static final long serialVersionUID = 1L; | |
| 28 | ||
| 29 | def String applicationId | |
| 30 | def String code | |
| 31 | def String name | |
| 32 | def boolean active | |
| 33 | def Long versionNumber | |
| 34 | def String objectId | |
| 35 | ||
| 36 | /** | |
| 37 | * Converts a mutable bo to its immutable counterpart | |
| 38 | * @param bo the mutable business object | |
| 39 | * @return the immutable object | |
| 40 | */ | |
| 41 | static Namespace to(NamespaceEbo bo) { | |
| 42 | 0 | if (bo == null) { |
| 43 | 0 | return null |
| 44 | } | |
| 45 | ||
| 46 | 0 | return Namespace.Builder.create(bo).build(); |
| 47 | } | |
| 48 | ||
| 49 | /** | |
| 50 | * Converts a immutable object to its mutable counterpart | |
| 51 | * @param im immutable object | |
| 52 | * @return the mutable bo | |
| 53 | */ | |
| 54 | static NamespaceEbo from(Namespace im) { | |
| 55 | 0 | if (im == null) { |
| 56 | 0 | return null |
| 57 | } | |
| 58 | ||
| 59 | 0 | NamespaceEbo bo = new NamespaceEbo() |
| 60 | 0 | bo.applicationId = im.applicationId |
| 61 | 0 | bo.active = im.active |
| 62 | 0 | bo.code = im.code |
| 63 | 0 | bo.name = im.name |
| 64 | 0 | bo.versionNumber = im.versionNumber |
| 65 | 0 | bo.objectId = im.objectId |
| 66 | ||
| 67 | 0 | return bo |
| 68 | } | |
| 69 | ||
| 70 | void refresh() { } | |
| 71 | } |