示例#1
0
 public Country(
     Planet parent,
     String iso3166alpha2Code,
     String iso3166alpha3Code,
     Integer iso3166numericCode,
     LocalizedString name,
     LocalizedString nationality,
     Class<AddressPrinter> iAddressPrinter) {
   super();
   setBennu(Bennu.getInstance());
   setUnit(
       Unit.create(
           parent.getUnit(),
           name,
           iso3166alpha3Code,
           getPartyType("País", COUNTRY_PARTYTYPE_NAME),
           getOrCreateAccountabilityType(),
           new LocalDate(),
           null,
           null));
   setIso3166alpha2Code(iso3166alpha2Code);
   setIAddressPrinter(iAddressPrinter);
   setIso3166alpha3Code(iso3166alpha3Code);
   setIso3166numericCode(iso3166numericCode);
   setNationality(nationality);
 }
示例#2
0
 public void update(
     Planet parent,
     String iso3166alpha2Code,
     String iso3166alpha3Code,
     Integer iso3166numericCode,
     LocalizedString name,
     LocalizedString nationality,
     Class<AddressPrinter> iAddressPrinter) {
   if (!same(getIso3166alpha2Code(), iso3166alpha2Code)
       || !same(getIso3166alpha3Code(), iso3166alpha3Code)
       || !same(getIso3166numericCode(), iso3166numericCode)
       || !same(getName(), name)
       || !same(getNationality(), nationality)
       || !same(getIAddressPrinter(), iAddressPrinter)) {
     final AccountabilityType type = getOrCreateAccountabilityType();
     getUnit()
         .getParentAccountabilityStream()
         .filter(a -> a.getAccountabilityType() == type)
         .forEach(a -> a.editDates(new LocalDate(), null, null));
     setUnit(
         Unit.create(
             parent.getUnit(),
             name,
             iso3166alpha3Code,
             getPartyType("País", COUNTRY_PARTYTYPE_NAME),
             getOrCreateAccountabilityType(),
             new LocalDate(),
             null,
             null));
     setIso3166alpha2Code(iso3166alpha2Code);
     setIAddressPrinter(iAddressPrinter);
     setIso3166alpha3Code(iso3166alpha3Code);
     setIso3166numericCode(iso3166numericCode);
     setNationality(nationality);
   }
 }
示例#3
0
  public Country(
      Planet parent,
      LocalizedString name,
      String acronym,
      Class iAddressPrinter,
      CountrySubdivisionLevelName... subdivisionNames) {
    super();
    setBennu(Bennu.getInstance());

    setIAddressPrinter(iAddressPrinter);
    setUnit(
        Unit.create(
            parent.getUnit(),
            name,
            acronym,
            getPartyType("País", COUNTRY_PARTYTYPE_NAME),
            getOrCreateAccountabilityType(),
            new LocalDate(),
            null,
            null));
    for (CountrySubdivisionLevelName subdivisionName : subdivisionNames) {
      addLevelName(subdivisionName);
    }
  }