当前位置: 首页>>代码示例>>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;未经允许,请勿转载。