Skip to content

Commit

Permalink
added ExtensionRegistry.isEmpty() as requested by protocolbuffers#52
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Dantes committed Apr 23, 2015
1 parent 0b19272 commit ab745a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions java/src/main/java/com/google/protobuf/ExtensionRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,22 @@ public class ExtensionRegistry extends ExtensionRegistryLite {
public static ExtensionRegistry newInstance() {
return new ExtensionRegistry();
}


/** Get the unmodifiable singleton empty instance. */
public static ExtensionRegistry getEmptyRegistry() {
return EMPTY;
}

/** check if instance is empty*/
public boolean isEmpty()
{
if(this == getEmptyRegistry())
{
return true;
}
else return false;
}


/** Returns an unmodifiable view of the registry. */
Expand Down

0 comments on commit ab745a2

Please sign in to comment.