Create AddressDataType from ProposalPerson

@param person ProposalPerson
@return AddressDataType corresponding to the ProposalPerson object.
429946
public AddressDataType getAddressDataType(ProposalPersonContract person) {

        AddressDataType addressType = AddressDataType.Factory.newInstance();
        if (person != null) {

            String street1 = person.getAddressLine1();
            addressType.setStreet1(street1);
            String street2 = person.getAddressLine2();
            if (street2 != null && !street2.equals("")) {                
                addressType.setStreet2(street2);
            }
            String city = person.getCity();
            addressType.setCity(city);

            String state = person.getState();
            if (state != null && !state.equals("")) {
                addressType.setState(state);
            }
            String zipcode = person.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                addressType.setZipCode(zipcode);
            }
            String county = person.getCounty();
            if (county != null && !county.equals("")) {
                addressType.setCounty(county);
            }
            String country = person.getCountryCode();
            CountryCodeType.Enum countryCode = null;
            if (country != null && !country.equals("")) {
                countryCode = CountryCodeType.Enum.forString(country);
            }
            addressType.setCountry(countryCode);
        }
        return addressType;
    }
1185889
public HumanNameDataType getHumanNameDataType(ProposalPersonContract person) {

		HumanNameDataType humanName = HumanNameDataType.Factory.newInstance();
		if (person != null) {
			humanName.setFirstName(person.getFirstName());
			humanName.setLastName(person.getLastName());
			String middleName = person.getMiddleName();
			if (middleName != null && !middleName.equals("")) {
				humanName.setMiddleName(middleName);
			}
		}
		return humanName;
	}
140269
public QYResultType create(QYUser user){
        BeanUtil.requireNonNull(user, "user is null");
        String url = BASE_API_URL + "cgi-bin/user/create?access_token=#";
        BaseResponse response = executePost(url, user.toJsonString());
        return QYResultType.get(response.getErrcode());
    }
1237060
public static V1BinaryAnnotation createAddress(String address, Endpoint endpoint) {
    if (endpoint == null) throw new NullPointerException("endpoint == null");
    return new V1BinaryAnnotation(address, null, endpoint);
  }
169583
@SneakyThrows
    public User getOrCreateUser(final Principal principal) {
        val attributes = principal.getAttributes();
        if (!attributes.containsKey(this.mailAttribute)) {
            throw new IllegalArgumentException("No email address found for " + principal.getId());
        }
        if (!attributes.containsKey(this.phoneAttribute)) {
            throw new IllegalArgumentException("No phone number found for " + principal.getId());
        }

        val email = attributes.get(this.mailAttribute).get(0).toString();
        val phone = attributes.get(this.phoneAttribute).get(0).toString();
        return this.authyUsers.createUser(email, phone, this.countryCode);
    }
987412
@NonNull
  public static UserDefinedType udt(@NonNull CqlIdentifier name) {
    return new ShallowUserDefinedType(null, name, false);
  }
785868
@Override
    public ApiPerson createOne(final String db, final ApiPerson person) {
        logger.info("Entering create person in db: " + db);
        return create(readRoot(db), person, (i, id) -> new ApiPerson(i, id));
    }
1269788
@RequestMapping("/head")
    public final String person(
            @RequestParam(value = "db",
                required = false,
                defaultValue = "schoeller") final String dbName,
            final Model model) {
        logger.debug("Entering head");

        final RenderingContext context = createRenderingContext();

        final Head head = fetchHead(dbName);

        final String filename = gedbrowserHome + "/" + dbName + ".ged";
        model.addAttribute("filename", filename);
        model.addAttribute("model", headRenderer(context, head));
        model.addAttribute("appInfo", appInfo);

        return "head";
    }
1081825
public Email recipient(EmailAddress recipient, RecipientType type) {
		recipient(new Recipient(recipient, type));
		return this;
	}
700592
@Programmatic
    public PostalAddress newPostal(
            final CommunicationChannelOwner owner,
            final CommunicationChannelType type,
            final String address1,
            final String address2,
            final String address3,
            final String postalCode,
            final String city,
            final State state,
            final Country country
            ) {
        final PostalAddress pa = repositoryService.instantiate(PostalAddress.class);
        pa.setType(type);
        pa.setAddress1(address1);
        pa.setAddress2(address2);
        pa.setAddress3(address3);
        pa.setCity(city);
        pa.setPostalCode(postalCode);
        pa.setState(state);
        pa.setCountry(country);
        pa.setOwner(owner);
        repositoryService.persist(pa);
        return pa;
    }
739321
static IDataModel createDataModelFromCell(Sheet sheet, FormulaParsingWorkbook workbook, IA1Address address) {
        IDataModel dm = new DataModel(randomUUID().toString());
        resolveCellDependencies(address, sheet, workbook).forEach(cell -> ConverterUtils.copyCell(new CellAddress(dm.getDataModelId(), cell), sheet, dm));
        return dm;
    }
507922
public UserAttributeType<PortletAppType<T>> getOrCreateUserAttribute()
   {
      List<Node> nodeList = childNode.get("user-attribute");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new UserAttributeTypeImpl<PortletAppType<T>>(this, "user-attribute", childNode, nodeList.get(0));
      }
      return createUserAttribute();
   }
25588
public Person newPerson() {
        Person p = new Person();
        p.firstname = firstnames[rand.nextInt(firstnames.length)];
        p.lastname = lastnames[rand.nextInt(lastnames.length)];
        p.sex = sexes[rand.nextInt(2)];
        p.dob = randomDOB();

        // state and area code match
        int i = rand.nextInt(areaCodes.length);
        p.phonenumber = randomPhone(areaCodes[i]);
        p.state = states[i];

        return p;
    }
893096
private static CreateRequestType checkType(final FormItemList formItemList,
			final CreateResponse createResponse) {
		final String sType = formItemList
				.getField(ProtocolConstants.Parameters.Create.TYPE);
		if (sType != null) {
			if (CreateRequestType.USER.getIdentifier().equals(sType)) {
				return CreateRequestType.USER;
			} else if (CreateRequestType.FOLLOW.getIdentifier().equals(sType)) {
				return CreateRequestType.FOLLOW;
			} else if (CreateRequestType.STATUS_UPDATE.getIdentifier().equals(
					sType)) {
				return CreateRequestType.STATUS_UPDATE;
			}

			createResponse.typeInvalid(sType);
		} else {
			createResponse.typeMissing();
		}

		return null;
	}
1063354
@SneakyThrows
    public static IPersonAttributeDao newStubAttributeRepository(final PrincipalAttributesProperties p) {
        val dao = new NamedStubPersonAttributeDao();
        val pdirMap = new LinkedHashMap<String, List<Object>>();
        val stub = p.getStub();
        stub.getAttributes().forEach((key, value) -> {
            val vals = StringUtils.commaDelimitedListToStringArray(value);
            pdirMap.put(key, Arrays.stream(vals).collect(Collectors.toList()));
        });
        dao.setBackingMap(pdirMap);
        if (StringUtils.hasText(stub.getId())) {
            dao.setId(stub.getId());
        }
        return dao;
    }
833463
private EventType createEventType(EventEnumType type) {
        EventType eventType = new EventType();
        eventType.setTimestamp(Converter.convertDate(new Date()));
        eventType.setEventType(type);

        OriginatorType origType = new OriginatorType();
        origType.setProcessId(Converter.getPID());
        try {
            InetAddress inetAddress = InetAddress.getLocalHost();
            origType.setIp(inetAddress.getHostAddress());
            origType.setHostname(inetAddress.getHostName());
        } catch (UnknownHostException e) {
            origType.setHostname("Unknown hostname");
            origType.setIp("Unknown ip address");
        }
        eventType.setOriginator(origType);

        String path = System.getProperty("karaf.home");
        CustomInfoType ciType = new CustomInfoType();
        CustomInfoType.Item cItem = new CustomInfoType.Item();
        cItem.setKey("path");
        cItem.setValue(path);
        ciType.getItem().add(cItem);
        eventType.setCustomInfo(ciType);

        return eventType;
    }
656192
@Override
    public IPersonAttributes getPerson(String uid) {

        final IPersonAttributes rslt = delegatePersonAttributeDao.getPerson(uid);
        if (rslt == null) {
            // Nothing we can do with that
            return null;
        }

        return postProcessPerson(rslt, uid);
    }