-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename NonGeographicalRegion to NonGeographicalEntity. #3627
Open
KarolJakubKrawiec
wants to merge
10
commits into
google:master
Choose a base branch
from
KarolJakubKrawiec:rename-nongeographicalregion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−50
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c4a156c
Rename NonGeographicalRegion to NonGeographicalEntity.
KarolJakubKrawiec 25e5548
Modify pending_code_changes.txt
KarolJakubKrawiec e6c61b5
Reform @deprecated anotation
KarolJakubKrawiec be17f26
Rename NonGeographicalRegion to NonGeographicalEntity
KarolJakubKrawiec eeda4b4
finish renaming NonGeoRegions to NonGeoEntities
KarolJakubKrawiec 426d869
Rewrote renaming for geographicalEntity
KarolJakubKrawiec 32e0765
Rename Region to Entity in GetMetadataForNonGeographicalEntity
KarolJakubKrawiec 67c88bb
Merge branch 'google:master' into rename-nongeographicalregion
KarolJakubKrawiec a595efa
Merge branch 'google:master' into rename-nongeographicalregion
KarolJakubKrawiec 75c58a8
Correct mistakes in pull request
KarolJakubKrawiec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,12 @@ class PhoneNumberUtilTest : public testing::Test { | |
|
||
const PhoneMetadata* GetMetadataForNonGeographicalRegion( | ||
int country_code) const { | ||
return phone_util_.GetMetadataForNonGeographicalRegion(country_code); | ||
return phone_util_.GetMetadataForNonGeographicalEntity(country_code); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also remove this because you already renamed the calls to this function. |
||
|
||
const PhoneMetadata* GetMetadataForNonGeographicalEntity( | ||
int country_code) const { | ||
return phone_util_.GetMetadataForNonGeographicalEntity(country_code); | ||
} | ||
|
||
void ExtractPossibleNumber(const string& number, | ||
|
@@ -341,7 +346,7 @@ TEST_F(PhoneNumberUtilTest, GetInstanceLoadARMetadata) { | |
} | ||
|
||
TEST_F(PhoneNumberUtilTest, GetInstanceLoadInternationalTollFreeMetadata) { | ||
const PhoneMetadata* metadata = GetMetadataForNonGeographicalRegion(800); | ||
const PhoneMetadata* metadata = GetMetadataForNonGeographicalEntity(800); | ||
EXPECT_FALSE(metadata == NULL); | ||
EXPECT_EQ("001", metadata->id()); | ||
EXPECT_EQ(800, metadata->country_code()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...c/com/google/i18n/phonenumbers/metadata/source/NonGeographicalEntityMetadataSourceV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) 2022 The Libphonenumber Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.i18n.phonenumbers.metadata.source; | ||
|
||
import com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata; | ||
|
||
/** | ||
* A source of phone metadata for non-geographical entities. | ||
* | ||
* <p>Non-geographical entities are phone number ranges that have a country calling code, but either | ||
* do not belong to an actual country (some international services), or belong to a region which has | ||
* a different country calling code from the country it is part of. Examples of such ranges are | ||
* those starting with: | ||
* | ||
* <ul> | ||
* <li>800 - country code assigned to the Universal International Freephone Service | ||
* <li>808 - country code assigned to the International Shared Cost Service | ||
* <li>870 - country code assigned to the Pitcairn Islands | ||
* <li>... | ||
* </ul> | ||
*/ | ||
public interface NonGeographicalEntityMetadataSourceV2 { | ||
|
||
/** | ||
* Gets phone metadata for a non-geographical entity. | ||
* | ||
* @param countryCallingCode the country calling code. | ||
* @return the phone metadata for that entity, or null if there is none. | ||
* @throws IllegalArgumentException if provided {@code countryCallingCode} does not belong to a | ||
* non-geographical entity | ||
*/ | ||
PhoneMetadata getMetadataForNonGeographicalEntity(int countryCallingCode); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
|
||
Code changes: | ||
- Renamed NonGeographicalRegion to NonGeographicalEntity. | ||
- Created a new interface called NonGeographicalEntityMetadataSourceV2 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this since it is a private function.