1 /**
2 * Copyright 2005-2014 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 package org.kuali.rice.krad.data;
17
18 import org.apache.commons.lang.StringUtils;
19
20 import java.io.Serializable;
21
22
23 /**
24 * PersistenceOption is used when saving through the data object service to configure how the data will be stored.
25 *
26 * @author Kuali Rice Team (rice.collab@kuali.org)
27 */
28 public class PersistenceOption implements Serializable {
29 private static final long serialVersionUID = 1L;
30
31 /**
32 * Used to link references and synchronize foreign keys in the data object.
33 */
34 public static PersistenceOption LINK_KEYS = new PersistenceOption("org.kuali.rice.krad.data.LINK_KEYS");
35
36 /**
37 * Used to synchronize the data object with the database.
38 */
39 public static PersistenceOption FLUSH = new PersistenceOption("org.kuali.rice.krad.data.FLUSH");
40
41 private final String optionId;
42
43 /**
44 * Sets the option Id
45 *
46 * @param optionId cannot be null or blank.
47 */
48 public PersistenceOption(String optionId) {
49 if (StringUtils.isBlank(optionId)) {
50 throw new IllegalArgumentException("optionId must not be a null or blank value");
51 }
52 this.optionId = optionId;
53 }
54
55 /**
56 * Gets the option id.
57 *
58 * @return not null or blank.
59 */
60 public String getOptionId() {
61 return this.optionId;
62 }
63
64 }