Skip to content

Commit

Permalink
Breaking Change: remove unnecessary overloads of methods:
Browse files Browse the repository at this point in the history
hasExtension
getExtensionCount
getExtension

PiperOrigin-RevId: 597702196
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jan 12, 2024
1 parent cdcd166 commit 94a2a44
Showing 1 changed file with 0 additions and 258 deletions.
258 changes: 0 additions & 258 deletions java/core/src/main/java/com/google/protobuf/GeneratedMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -975,57 +975,6 @@ public interface ExtendableMessageOrBuilder<MessageT extends ExtendableMessage<M

/** Get one element of a repeated extension. */
<T> T getExtension(ExtensionLite<MessageT, List<T>> extension, int index);

/**
* Check if a singular extension is present.
* <p>TODO: handled by ExtensionLite version
*/
<T> boolean hasExtension(
Extension<MessageT, T> extension);
/**
* Check if a singular extension is present.
* <p>TODO: handled by ExtensionLite version
*/
<T> boolean hasExtension(
GeneratedExtension<MessageT, T> extension);
/**
* Get the number of elements in a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
<T> int getExtensionCount(
Extension<MessageT, List<T>> extension);
/**
* Get the number of elements in a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
<T> int getExtensionCount(
GeneratedExtension<MessageT, List<T>> extension);
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
<T> T getExtension(
Extension<MessageT, T> extension);
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
<T> T getExtension(
GeneratedExtension<MessageT, T> extension);
/**
* Get one element of a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
<T> T getExtension(
Extension<MessageT, List<T>> extension,
int index);
/**
* Get one element of a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
<T> T getExtension(
GeneratedExtension<MessageT, List<T>> extension,
int index);
}

/**
Expand Down Expand Up @@ -1142,77 +1091,6 @@ public final <T> T getExtension(
extension.singularFromReflectionType(extensions.getRepeatedField(descriptor, index));
}

/**
* Check if a singular extension is present.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> boolean hasExtension(final Extension<MessageT, T> extension) {
return hasExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Check if a singular extension is present.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> boolean hasExtension(
final GeneratedExtension<MessageT, T> extension) {
return hasExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Get the number of elements in a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> int getExtensionCount(
final Extension<MessageT, List<T>> extension) {
return getExtensionCount((ExtensionLite<MessageT, List<T>>) extension);
}
/**
* Get the number of elements in a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> int getExtensionCount(
final GeneratedExtension<MessageT, List<T>> extension) {
return getExtensionCount((ExtensionLite<MessageT, List<T>>) extension);
}
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(final Extension<MessageT, T> extension) {
return getExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(
final GeneratedExtension<MessageT, T> extension) {
return getExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Get one element of a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(
final Extension<MessageT, List<T>> extension, final int index) {
return getExtension((ExtensionLite<MessageT, List<T>>) extension, index);
}
/**
* Get one element of a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(
final GeneratedExtension<MessageT, List<T>> extension, final int index) {
return getExtension((ExtensionLite<MessageT, List<T>>) extension, index);
}

/** Called by subclasses to check if all extensions are initialized. */
protected boolean extensionsAreInitialized() {
return extensions.isInitialized();
Expand Down Expand Up @@ -1601,142 +1479,6 @@ public final <T> BuilderT clearExtension(final ExtensionLite<MessageT, T> extens
return (BuilderT) this;
}

/**
* Check if a singular extension is present.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> boolean hasExtension(final Extension<MessageT, T> extension) {
return hasExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Check if a singular extension is present.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> boolean hasExtension(
final GeneratedExtension<MessageT, T> extension) {
return hasExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Get the number of elements in a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> int getExtensionCount(
final Extension<MessageT, List<T>> extension) {
return getExtensionCount((ExtensionLite<MessageT, List<T>>) extension);
}
/**
* Get the number of elements in a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> int getExtensionCount(
final GeneratedExtension<MessageT, List<T>> extension) {
return getExtensionCount((ExtensionLite<MessageT, List<T>>) extension);
}
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(final Extension<MessageT, T> extension) {
return getExtension((ExtensionLite<MessageT, T>) extension);
}
/** Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(
final GeneratedExtension<MessageT, T> extension) {
return getExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(
final Extension<MessageT, List<T>> extension, final int index) {
return getExtension((ExtensionLite<MessageT, List<T>>) extension, index);
}
/**
* Get the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
@Override
public final <T> T getExtension(
final GeneratedExtension<MessageT, List<T>> extension, final int index) {
return getExtension((ExtensionLite<MessageT, List<T>>) extension, index);
}
/**
* Set the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
public final <T> BuilderT setExtension(
final Extension<MessageT, T> extension, final T value) {
return setExtension((ExtensionLite<MessageT, T>) extension, value);
}
/**
* Set the value of an extension.
* <p>TODO: handled by ExtensionLite version
*/
public <T> BuilderT setExtension(
final GeneratedExtension<MessageT, T> extension, final T value) {
return setExtension((ExtensionLite<MessageT, T>) extension, value);
}
/**
* Set the value of one element of a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
public final <T> BuilderT setExtension(
final Extension<MessageT, List<T>> extension,
final int index, final T value) {
return setExtension((ExtensionLite<MessageT, List<T>>) extension, index, value);
}
/**
* Set the value of one element of a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
public <T> BuilderT setExtension(
final GeneratedExtension<MessageT, List<T>> extension,
final int index, final T value) {
return setExtension((ExtensionLite<MessageT, List<T>>) extension, index, value);
}
/**
* Append a value to a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
public final <T> BuilderT addExtension(
final Extension<MessageT, List<T>> extension, final T value) {
return addExtension((ExtensionLite<MessageT, List<T>>) extension, value);
}
/**
* Append a value to a repeated extension.
* <p>TODO: handled by ExtensionLite version
*/
public <T> BuilderT addExtension(
final GeneratedExtension<MessageT, List<T>> extension, final T value) {
return addExtension((ExtensionLite<MessageT, List<T>>) extension, value);
}
/**
* Clear an extension.
* <p>TODO: handled by ExtensionLite version
*/
public final <T> BuilderT clearExtension(
final Extension<MessageT, T> extension) {
return clearExtension((ExtensionLite<MessageT, T>) extension);
}
/**
* Clears an extension.
* <p>TODO: handled by ExtensionLite version
*/
public <T> BuilderT clearExtension(
final GeneratedExtension<MessageT, T> extension) {
return clearExtension((ExtensionLite<MessageT, T>) extension);
}

/** Called by subclasses to check if all extensions are initialized. */
protected boolean extensionsAreInitialized() {
return extensions == null || extensions.isInitialized();
Expand Down

0 comments on commit 94a2a44

Please sign in to comment.