Ejemplo n.º 1
0
 public bool exactlySameAs(PhoneNumber other)
 {
     if (other == null)
     {
         return(false);
     }
     if (this == other)
     {
         return(true);
     }
     return(countryCode_ == other.countryCode_ && nationalNumber_ == other.nationalNumber_ &&
            extension_.Equals(other.extension_) && italianLeadingZero_ == other.italianLeadingZero_ &&
            numberOfLeadingZeros_ == other.numberOfLeadingZeros_ &&
            rawInput_.Equals(other.rawInput_) && countryCodeSource_ == other.countryCodeSource_ &&
            preferredDomesticCarrierCode_.Equals(other.preferredDomesticCarrierCode_) &&
            HasPreferredDomesticCarrierCode() == other.HasPreferredDomesticCarrierCode());
 }
Ejemplo n.º 2
0
 public PhoneNumber mergeFrom(PhoneNumber other)
 {
     if (other.HasCountryCode())
     {
         setCountryCode(other.getCountryCode());
     }
     if (other.HasNationalNumber())
     {
         setNationalNumber(other.getNationalNumber());
     }
     if (other.HasExtension())
     {
         setExtension(other.getExtension());
     }
     if (other.HasItalianLeadingZero())
     {
         setItalianLeadingZero(other.isItalianLeadingZero());
     }
     if (other.HasNumberOfLeadingZeros())
     {
         setNumberOfLeadingZeros(other.getNumberOfLeadingZeros());
     }
     if (other.HasRawInput())
     {
         setRawInput(other.getRawInput());
     }
     if (other.HasCountryCodeSource())
     {
         setCountryCodeSource(other.getCountryCodeSource());
     }
     if (other.HasPreferredDomesticCarrierCode())
     {
         setPreferredDomesticCarrierCode(other.getPreferredDomesticCarrierCode());
     }
     return(this);
 }