當前位置: 首頁>>代碼示例>>Java>>正文


Java CountyContract類代碼示例

本文整理匯總了Java中org.kuali.rice.location.api.county.CountyContract的典型用法代碼示例。如果您正苦於以下問題:Java CountyContract類的具體用法?Java CountyContract怎麽用?Java CountyContract使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CountyContract類屬於org.kuali.rice.location.api.county包,在下文中一共展示了CountyContract類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isExternalizable

import org.kuali.rice.location.api.county.CountyContract; //導入依賴的package包/類
@Override
public boolean isExternalizable(Class boClass) {
    if(CampusContract.class.isAssignableFrom(boClass)){
        return true;
    } else if(StateContract.class.isAssignableFrom(boClass)){
        return true;
    } else if(CountryContract.class.isAssignableFrom(boClass)){
        return true;
    } else if (CountyContract.class.isAssignableFrom(boClass)) {
        return true;
    } else if (PostalCodeContract.class.isAssignableFrom(boClass)) {
        return true;
    }
    return false;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:LocationRemoteModuleService.java

示例2: getExternalizableBusinessObject

import org.kuali.rice.location.api.county.CountyContract; //導入依賴的package包/類
public <T extends ExternalizableBusinessObject> T getExternalizableBusinessObject(Class<T> businessObjectClass, Map<String, Object> fieldValues) {
    if(CampusContract.class.isAssignableFrom(businessObjectClass)){
        if(isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.CODE)){
            Campus campus = getCampusService().getCampus((String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.CODE));
            return (T) CampusBo.from(campus);
        }
    } else if(StateContract.class.isAssignableFrom(businessObjectClass)){
        if(isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.COUNTRY_CODE)
                && isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.CODE)) {
            State state = getStateService().getState((String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.COUNTRY_CODE), (String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.CODE));
            return (T) StateBo.from(state);
        }
    } else if(CountryContract.class.isAssignableFrom(businessObjectClass)){
        if(isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.CODE)) {
            Country country = getCountryService().getCountry((String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.CODE));
            return (T) CountryBo.from(country);
        }
    } else if (CountyContract.class.isAssignableFrom(businessObjectClass)) {
        if (isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.CODE)
                && isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.COUNTRY_CODE)
                && isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.STATE_CODE)) {
            County county = getCountyService().getCounty((String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.COUNTRY_CODE), (String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.STATE_CODE), (String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.CODE));
            return (T)CountyBo.from(county);
        }
    } else if (PostalCodeContract.class.isAssignableFrom(businessObjectClass)) {
        if (isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.CODE)
                && isNonBlankValueForKey(fieldValues, LocationConstants.PrimaryKeyConstants.COUNTRY_CODE)) {
            PostalCode postalCode = getPostalCodeService().getPostalCode((String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.COUNTRY_CODE), (String) fieldValues.get(
                    LocationConstants.PrimaryKeyConstants.CODE));
            return (T)PostalCodeBo.from(postalCode);
        }
    }
    return null;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:43,代碼來源:LocationRemoteModuleService.java

示例3: queryForEbos

import org.kuali.rice.location.api.county.CountyContract; //導入依賴的package包/類
public <T extends ExternalizableBusinessObject> List<T> queryForEbos(
        Class<T> businessObjectClass, QueryByCriteria query) {

    if ( StateContract.class.isAssignableFrom( businessObjectClass ) ) {
        Collection<State> states = getStateService().findStates(query).getResults();
        List<StateEbo> stateEbos = new ArrayList<StateEbo>(states.size());
        for (State state : states) {
            stateEbos.add(StateBo.from(state));
        }
        return (List<T>)stateEbos;
    } else if ( CampusContract.class.isAssignableFrom( businessObjectClass ) ) {
        Collection<Campus> campuses = getCampusService().findCampuses(query).getResults();
        List<CampusEbo> campusEbos = new ArrayList<CampusEbo>(campuses.size());
        for (Campus campus : campuses) {
            campusEbos.add(CampusBo.from(campus));
        }
        return (List<T>)campusEbos;
    } else if ( CountryContract.class.isAssignableFrom( businessObjectClass ) ) {
        Collection<Country> countries = getCountryService().findCountries(query).getResults();
        List<CountryEbo> countryEbos = new ArrayList<CountryEbo>(countries.size());
        for (Country country : countries) {
            countryEbos.add(CountryBo.from(country));
        }
        return (List<T>)countryEbos;
    } else if ( CountyContract.class.isAssignableFrom( businessObjectClass ) ) {
        Collection<County> counties = getCountyService().findCounties(query).getResults();
        List<CountyEbo> countyEbos = new ArrayList<CountyEbo>(counties.size());
        for (County county : counties) {
            countyEbos.add(CountyBo.from(county));
        }
        return (List<T>)countyEbos;
    } else if ( PostalCodeContract.class.isAssignableFrom( businessObjectClass ) ) {
        Collection<PostalCode> postalCodes = getPostalCodeService().findPostalCodes(query).getResults();
        List<PostalCodeEbo> postalCodeEbos = new ArrayList<PostalCodeEbo>(postalCodes.size());
        for (PostalCode postalCode : postalCodes) {
            postalCodeEbos.add(PostalCodeBo.from(postalCode));
        }
        return (List<T>)postalCodeEbos;
    }
    // Not responsible for other types -- so return empty list?
    return Collections.emptyList();

}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:44,代碼來源:LocationRemoteModuleService.java


注:本文中的org.kuali.rice.location.api.county.CountyContract類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。