• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Address类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.osiam.resources.scim.Address的典型用法代码示例。如果您正苦于以下问题:Java Address类的具体用法?Java Address怎么用?Java Address使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Address类属于org.osiam.resources.scim包,在下文中一共展示了Address类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fromScim

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public AddressEntity fromScim(Address scim) {
    if (scim == null) {
        return null;
    }
    AddressEntity addressEntity = new AddressEntity();
    addressEntity.setCountry(scim.getCountry());
    addressEntity.setFormatted(scim.getFormatted());
    addressEntity.setLocality(scim.getLocality());
    addressEntity.setPostalCode(scim.getPostalCode());
    addressEntity.setPrimary(scim.isPrimary());
    addressEntity.setRegion(scim.getRegion());
    addressEntity.setStreetAddress(scim.getStreetAddress());
    addressEntity.setType(scim.getType());
    addressEntity.setDisplay(scim.getDisplay());
    return addressEntity;
}
 
开发者ID:osiam,项目名称:osiam,代码行数:18,代码来源:AddressConverter.java


示例2: toScim

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public Address toScim(AddressEntity entity) {
    if (entity == null) {
        return null;
    }
    return new Address.Builder()
            .setCountry(entity.getCountry())
            .setFormatted(entity.getFormatted())
            .setLocality(entity.getLocality())
            .setPostalCode(entity.getPostalCode())
            .setRegion(entity.getRegion())
            .setStreetAddress(entity.getStreetAddress())
            .setPrimary(entity.isPrimary())
            .setType(entity.getType())
            .setDisplay(entity.getDisplay())
            .build();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:18,代码来源:AddressConverter.java


示例3: update

import org.osiam.resources.scim.Address; //导入依赖的package包/类
/**
 * updates (adds new, delete, updates) the addresses of the given {@link UserEntity} based on the given List of
 * {@link Address}
 *
 * @param address    list of {@link Address} to be deleted, updated or added
 * @param userEntity user who needs to be updated
 * @param attributes all {@link AddressEntity}'s will be deleted if this Set contains 'address'
 */
void update(List<Address> address, UserEntity userEntity, Set<String> attributes) {

    if (attributes.contains("addresses")) {
        userEntity.removeAllAddresses();
    }

    if (address != null) {
        for (Address scimAddress : address) {
            AddressEntity addressEntity = addressConverter.fromScim(scimAddress);
            userEntity.removeAddress(addressEntity); // we always have to remove the address in case
            // the primary attribute has changed
            if (Strings.isNullOrEmpty(scimAddress.getOperation())
                    || !scimAddress.getOperation().equalsIgnoreCase("delete")) {

                ensureOnlyOnePrimaryAddressExists(addressEntity, userEntity.getAddresses());
                userEntity.addAddress(addressEntity);
            }
        }
    }
}
 
开发者ID:osiam,项目名称:osiam,代码行数:29,代码来源:AddressUpdater.java


示例4: fromScim

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public AddressEntity fromScim(Address scim) {
    if (scim == null) {
        return null;
    }
    AddressEntity addressEntity = new AddressEntity();
    addressEntity.setCountry(scim.getCountry());
    addressEntity.setFormatted(scim.getFormatted());
    addressEntity.setLocality(scim.getLocality());
    addressEntity.setPostalCode(scim.getPostalCode());
    addressEntity.setPrimary(scim.isPrimary());
    addressEntity.setRegion(scim.getRegion());
    addressEntity.setStreetAddress(scim.getStreetAddress());
    addressEntity.setType(scim.getType());

    return addressEntity;
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:18,代码来源:AddressConverter.java


示例5: toScim

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public Address toScim(AddressEntity entity) {
    if (entity == null) {
        return null;
    }
    return new Address.Builder()
            .setCountry(entity.getCountry())
            .setFormatted(entity.getFormatted())
            .setLocality(entity.getLocality())
            .setPostalCode(entity.getPostalCode())
            .setRegion(entity.getRegion())
            .setStreetAddress(entity.getStreetAddress())
            .setPrimary(entity.isPrimary())
            .setType(entity.getType())
            .build();
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:17,代码来源:AddressConverter.java


示例6: update

import org.osiam.resources.scim.Address; //导入依赖的package包/类
/**
 * updates (adds new, delete, updates) the addresses of the given {@link UserEntity} based on the given List of
 * {@link Address}
 *
 * @param addresss   list of {@link Address} to be deleted, updated or added
 * @param userEntity user who needs to be updated
 * @param attributes all {@link AddressEntity}'s will be deleted if this Set contains 'address'
 */
void update(List<Address> addresss, UserEntity userEntity, Set<String> attributes) {

    if (attributes.contains("addresses")) {
        userEntity.removeAllAddresses();
    }

    if (addresss != null) {
        for (Address scimAddress : addresss) {
            AddressEntity addressEntity = addressConverter.fromScim(scimAddress);
            userEntity.removeAddress(addressEntity); // we always have to remove the address in case
            // the primary attribute has changed
            if (Strings.isNullOrEmpty(scimAddress.getOperation())
                    || !scimAddress.getOperation().equalsIgnoreCase("delete")) {

                ensureOnlyOnePrimaryAddressExists(addressEntity, userEntity.getAddresses());
                userEntity.addAddress(addressEntity);
            }
        }
    }
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:29,代码来源:AddressUpdater.java


示例7: updateAddress

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Command(description = "Update an address from the user.", startsSubshell = true)
public void updateAddress(
		@Param(value = "searchKey", description = "Which key should be used to identify the address.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the address will updated.")
		String valueExp) throws IOException{

	Set<Address> addresses = builderCommand.showAllAddresses();
	for(Address current : addresses){
		if(match(current, key, valueExp)){
			final Address address = builderCommand.builderShellFactory.enterAddressShell(current);
			if(address != null){
				builderCommand.builder.updateAddress(current, address);
			}
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:18,代码来源:UpdateUserUpdateCommands.java


示例8: enterAddressShell

import org.osiam.resources.scim.Address; //导入依赖的package包/类
/**
 * Enter a new subshell for creating an {@link Address}.
 *
 * @param current The current persisted {@link Address}.
 * @return The {@link Address}. Or null if the user interrupt the process.
 * @throws IOException
 */
public Address enterAddressShell(Address current) throws IOException {
	final AddressBuilder addressBuilder = new AddressBuilder(current);

	final Shell subShell = ShellBuilder.subshell((current == null ? "create" : "replace") + "-address", shell)
		.behavior()
			.disableExitCommand()
			.addHandler(addressBuilder)
		.build();

	output.out()
		.normal("In this subshell you can create an address. Leave this sub shell via \"commit\" to persist the changes.")
	.println();

	subShell.commandLoop();

	return addressBuilder.build();
}
 
开发者ID:osiam,项目名称:shell,代码行数:25,代码来源:BuilderShellFactory.java


示例9: assertThatAddressesAreEqual

import org.osiam.resources.scim.Address; //导入依赖的package包/类
private void assertThatAddressesAreEqual(List<Address> expected, List<Address> actual) {
    assertEquals(expected.size(), actual.size());
    ensureListSizeIsOne(expected);
    Address expectedValue = expected.get(0);
    Address actualValue = actual.get(0);

    assertEquals(expectedValue.getType(), actualValue.getType());
    assertEquals(expectedValue.isPrimary(), actualValue.isPrimary());
    assertEquals(expectedValue.getDisplay(), actualValue.getDisplay());
    assertEquals(expectedValue.getCountry(), actualValue.getCountry());
    assertEquals(expectedValue.getFormatted(), actualValue.getFormatted());
    assertEquals(expectedValue.getLocality(), actualValue.getLocality());
    assertEquals(expectedValue.getPostalCode(), actualValue.getPostalCode());
    assertEquals(expectedValue.getRegion(), actualValue.getRegion());
    assertEquals(expectedValue.getStreetAddress(), actualValue.getStreetAddress());
}
 
开发者ID:osiam,项目名称:connector4java-integration-tests,代码行数:17,代码来源:CompleteUserIT.java


示例10: updateAddress

import org.osiam.resources.scim.Address; //导入依赖的package包/类
private void updateAddress(UpdateUser.Builder updateBuilder, List<Address> addresses,
        DirContextOperations ldapUserData) {
    for (Address address : addresses) {
        if (address.getType() != null && address.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteAddress(address);
        }
    }

    List<Address> newAddresses = getAddresses(ldapUserData);
    if (!newAddresses.isEmpty()) {
        updateBuilder.addAddress(newAddresses.get(0));
    }
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:14,代码来源:OsiamLdapUserContextMapper.java


示例11: convertToDatabaseColumn

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public String convertToDatabaseColumn(Address.Type attribute) {
    if (attribute == null || Strings.isNullOrEmpty(attribute.getValue())) {
        return null;
    }

    return attribute.getValue();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:AddressTypeConverter.java


示例12: convertToEntityAttribute

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public Address.Type convertToEntityAttribute(String dbData) {
    if (Strings.isNullOrEmpty(dbData)) {
        return null;
    }

    return new Address.Type(dbData);
}
 
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:AddressTypeConverter.java


示例13: AddressCommand

import org.osiam.resources.scim.Address; //导入依赖的package包/类
public AddressCommand(Address address) {
    setPrimary(address.isPrimary());
    setCountry(address.getCountry());
    setFormatted(address.getFormatted());
    setLocality(address.getLocality());
    setPostalcode(address.getPostalCode());
    setRegion(address.getRegion());
    setStreetaddress(address.getStreetAddress());

    if (address.getType() != null) {
        setType(address.getType().getValue());
    }
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:14,代码来源:AddressCommand.java


示例14: getAsAddress

import org.osiam.resources.scim.Address; //导入依赖的package包/类
public Address getAsAddress() {
    return new Address.Builder()
            .setPrimary(getPrimary())
            .setCountry(getCountry())
            .setFormatted(getFormatted())
            .setLocality(getLocality())
            .setPostalCode(getPostalcode())
            .setRegion(getRegion())
            .setStreetAddress(getStreetaddress())
            .setType(new Type(getType()))
            .build();
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:13,代码来源:AddressCommand.java


示例15: deleteAddress

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Command(description = "Delete an address from the user.")
public void deleteAddress(
		@Param(value = "searchKey", description = "Which key should be used to identify the address.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the address will deleted.")
		String valueExp){
	
	Set<Address> addresses = builderCommand.showAllAddresses();
	for(Address current : addresses){
		if(match(current, key, valueExp)){
			builderCommand.builder.deleteAddress(current);
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:UpdateUserDeleteCommands.java


示例16: addAddress

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Command(description = "Add an address for this user.", startsSubshell = true)
public void addAddress() throws IOException {
	final Address address = builderCommand.builderShellFactory.enterAddressShell();
	if(address != null){
		builderCommand.builder.addAddress(address);
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserAddCommands.java


示例17: addresses

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Command(description = "Show all addresses (persited and non persisted) for the user.")
public Set<Address> showAllAddresses(){
	Set<Address> all = new HashSet<>(user.getAddresses());
	all.addAll(_build().getScimConformUpdateUser().getAddresses());
	
	return all;
}
 
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserBuilder.java


示例18: deleteAddress

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Command(description = "Delete an address from the user.")
public void deleteAddress(
		@Param(value = "searchKey", description = "Which key should be used to identify the address.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the address will deleted.")
		String valueExp){
	
	List<Address> addresses = builderCommand.showAllAddresses();
	for(Address current : addresses){
		if(match(current, key, valueExp)){
			builderCommand.builder.removeAddress(current);
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:CreateUserDeleteCommands.java


示例19: convertOutput

import org.osiam.resources.scim.Address; //导入依赖的package包/类
@Override
public Object convertOutput(Object toBeFormatted) {
	if(!(toBeFormatted instanceof Address)) return null;
	
	final Address address = (Address)toBeFormatted;
	
	try {
		return toString(address);
	} catch (JsonProcessingException e) {
		return e;
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:13,代码来源:AddressConverter.java


示例20: getAddresses

import org.osiam.resources.scim.Address; //导入依赖的package包/类
private static ArrayList<Address> getAddresses(int countCurrentUser) {

        ArrayList<Address> addresses = new ArrayList<Address>();
        addresses.add(getNewAddress(countCurrentUser, true, Address.Type.WORK));
        addresses.add(getNewAddress(countCurrentUser, false, Address.Type.HOME));
        addresses.add(getNewAddress(countCurrentUser, false, Address.Type.OTHER));

        return addresses;
    }
 
开发者ID:osiam,项目名称:test-suites,代码行数:10,代码来源:TestDataCreation.java



注:本文中的org.osiam.resources.scim.Address类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PersistentNode类代码示例发布时间:2022-05-22
下一篇:
Java ModelBuilderI类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap