Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
StateService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2008 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.kns.service; | |
17 | ||
18 | import java.util.List; | |
19 | ||
20 | import org.kuali.rice.kns.bo.State; | |
21 | ||
22 | public interface StateService { | |
23 | ||
24 | /** | |
25 | * get a state object based on the given state code and default country code. The default country code is set up in the system. | |
26 | * | |
27 | * @param postalStateCode the given state code | |
28 | * @return a state object based on the given state code and default country code | |
29 | */ | |
30 | public State getByPrimaryId(String postalStateCode); | |
31 | ||
32 | /** | |
33 | * get a state object based on the given state code and country code | |
34 | * | |
35 | * @param postalCountryCode the given country code | |
36 | * @param postalStateCode the given state code | |
37 | * @return a state object based on the given state code and country code | |
38 | */ | |
39 | public State getByPrimaryId(String postalCountryCode, String postalStateCode); | |
40 | ||
41 | /** | |
42 | * get a state object based on the given state code and default country code. The default country code is set up in the system. The default country code is set up in | |
43 | * the system. If the given postal state code is same as that of the given existing postal code, return the existing postal code; | |
44 | * otherwise, retrieve a state object. | |
45 | * | |
46 | * @param postalStateCode the given state code | |
47 | * @return a state object based on the given state code and default country code | |
48 | */ | |
49 | public State getByPrimaryIdIfNecessary(String postalStateCode, State existingState); | |
50 | ||
51 | /** | |
52 | * get a state object based on the given state code and country code. If the given postal state code and country code | |
53 | * are same as those of the given existing postal code, return the existing State; otherwise, retrieve a State | |
54 | * object. | |
55 | * | |
56 | * @param postalCountryCode the given country code | |
57 | * @param postalStateCode the given state code | |
58 | * @return a state object based on the given state code and country code | |
59 | */ | |
60 | public State getByPrimaryIdIfNecessary(String postalCountryCode, String postalStateCode, State existingState); | |
61 | ||
62 | /** | |
63 | * get all states in the system-default country | |
64 | * @return all states in the system-default country | |
65 | */ | |
66 | public List<State> findAllStates(); | |
67 | ||
68 | /** | |
69 | * get all states in the given country | |
70 | * @param postalCountryCode the given country code | |
71 | * @return all states in the given country | |
72 | */ | |
73 | public List<State> findAllStates(String postalCountryCode); | |
74 | } |