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

Java PhoneNumber类代码示例

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

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



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

示例1: update

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

    if (attributes.contains("phoneNumbers")) {
        userEntity.removeAllPhoneNumbers();
    }

    if (phoneNumbers != null) {
        for (PhoneNumber scimPhoneNumber : phoneNumbers) {
            PhoneNumberEntity phoneNumberEntity = phoneNumberConverter.fromScim(scimPhoneNumber);
            userEntity.removePhoneNumber(phoneNumberEntity); // we always have to remove the phoneNumber in case
            // the primary attribute has changed
            if (Strings.isNullOrEmpty(scimPhoneNumber.getOperation())
                    || !scimPhoneNumber.getOperation().equalsIgnoreCase("delete")) {

                ensureOnlyOnePrimaryPhoneNumberExists(phoneNumberEntity, userEntity.getPhoneNumbers());
                userEntity.addPhoneNumber(phoneNumberEntity);
            }
        }
    }
}
 
开发者ID:osiam,项目名称:osiam,代码行数:29,代码来源:PhoneNumberUpdater.java


示例2: updatePhoneNumber

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

	Set<PhoneNumber> phoneNumbers = builderCommand.showAllPhoneNumbers();
	for(PhoneNumber current : phoneNumbers){
		if(match(current, key, valueExp)){
			final PhoneNumber phoneNumber = builderCommand.builderShellFactory.enterPhoneNumberShell(current);
			if(phoneNumber != null){
				builderCommand.builder.updatePhoneNumber(current, phoneNumber);
			}
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:18,代码来源:UpdateUserUpdateCommands.java


示例3: enterPhoneNumberShell

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

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

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

	subShell.commandLoop();

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


示例4: updatePhoneNumber

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
private void updatePhoneNumber(UpdateUser.Builder updateBuilder, List<PhoneNumber> phoneNumbers, String value) {
    PhoneNumber newPhoneNumber = new PhoneNumber.Builder().setValue(value)
            .setType(new PhoneNumber.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (PhoneNumber phoneNumber : phoneNumbers) {
        if (phoneNumber.getType() != null
                && phoneNumber.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deletePhoneNumber(phoneNumber);
        }
    }
    updateBuilder.addPhoneNumber(newPhoneNumber);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:12,代码来源:OsiamLdapUserContextMapper.java


示例5: fromScim

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
@Override
public PhoneNumberEntity fromScim(PhoneNumber scim) {
    PhoneNumberEntity phoneNumberEntity = new PhoneNumberEntity();
    phoneNumberEntity.setValue(String.valueOf(scim.getValue()));
    phoneNumberEntity.setType(scim.getType());
    phoneNumberEntity.setPrimary(scim.isPrimary());
    phoneNumberEntity.setDisplay(scim.getDisplay());
    return phoneNumberEntity;
}
 
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:PhoneNumberConverter.java


示例6: toScim

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
@Override
public PhoneNumber toScim(PhoneNumberEntity entity) {
    return new PhoneNumber.Builder()
            .setType(entity.getType())
            .setValue(entity.getValue())
            .setPrimary(entity.isPrimary())
            .setDisplay(entity.getDisplay())
            .build();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:PhoneNumberConverter.java


示例7: convertToDatabaseColumn

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

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


示例8: convertToEntityAttribute

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

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


示例9: fromScim

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
@Override
public PhoneNumberEntity fromScim(PhoneNumber scim) {
    PhoneNumberEntity phoneNumberEntity = new PhoneNumberEntity();
    phoneNumberEntity.setValue(String.valueOf(scim.getValue()));
    phoneNumberEntity.setType(scim.getType());
    phoneNumberEntity.setPrimary(scim.isPrimary());

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


示例10: toScim

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
@Override
public PhoneNumber toScim(PhoneNumberEntity entity) {
    return new PhoneNumber.Builder()
            .setType(entity.getType())
            .setValue(entity.getValue())
            .setPrimary(entity.isPrimary())
            .build();
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:9,代码来源:PhoneNumberConverter.java


示例11: PhoneNumberCommand

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
public PhoneNumberCommand(PhoneNumber phoneNumber) {
    setDisplay(phoneNumber.getDisplay());
    setPrimary(phoneNumber.isPrimary());
    setValue(phoneNumber.getValue());

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


示例12: getAsPhoneNumber

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
public PhoneNumber getAsPhoneNumber() {
    return new PhoneNumber.Builder()
            .setDisplay(getDisplay())
            .setPrimary(getPrimary())
            .setType(new Type(getType()))
            .setValue(getValue())
            .build();
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:9,代码来源:PhoneNumberCommand.java


示例13: deletePhoneNumber

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


示例14: addPhoneNumber

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


示例15: numbers

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


示例16: deletePhoneNumber

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


示例17: convertOutput

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


示例18: getPhoneNumbers

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

        ArrayList<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>();
        phoneNumbers.add(getNewPhoneNumber(countCurrentUser, true, PhoneNumber.Type.WORK));
        phoneNumbers.add(getNewPhoneNumber(countCurrentUser, false, PhoneNumber.Type.HOME));
        phoneNumbers.add(getNewPhoneNumber(countCurrentUser, false, PhoneNumber.Type.OTHER));

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


示例19: getNewPhoneNumber

import org.osiam.resources.scim.PhoneNumber; //导入依赖的package包/类
private static PhoneNumber getNewPhoneNumber(int countCurrentUser, boolean primary, PhoneNumber.Type type) {
    return new PhoneNumber.Builder()
            .setPrimary(primary)
            .setType(type)
            .setValue("049123" + countCurrentUser)
            .build();
}
 
开发者ID:osiam,项目名称:test-suites,代码行数:8,代码来源:TestDataCreation.java


示例20: assertThatPhoneNumbersAreEqual

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

    assertEquals(expectedValue.getType(), actualValue.getType());
    assertEquals(expectedValue.getValue(), actualValue.getValue());
    assertEquals(expectedValue.isPrimary(), actualValue.isPrimary());
    assertEquals(expectedValue.getDisplay(), actualValue.getDisplay());
}
 
开发者ID:osiam,项目名称:connector4java-integration-tests,代码行数:12,代码来源:CompleteUserIT.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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