Class BaseGoogleAdsException.Factory<T extends BaseGoogleAdsException,U extends com.google.protobuf.Message>
- java.lang.Object
-
- com.google.ads.googleads.lib.stubs.exceptions.BaseGoogleAdsException.Factory<T,U>
-
- Enclosing class:
- BaseGoogleAdsException
public abstract static class BaseGoogleAdsException.Factory<T extends BaseGoogleAdsException,U extends com.google.protobuf.Message> extends java.lang.ObjectOptionally create a GoogleAdsException from a ApiException.Returns an Optional containing the underlying GoogleAdsException if the ApiException contains the appropriate metadata.
Returns an empty Optional if the required metadata is not present or is not parsable.
-
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TcreateException(com.google.api.gax.rpc.ApiException source, byte[] protoData, io.grpc.Metadata metadata)java.util.Optional<T>createGoogleAdsException(com.google.api.gax.rpc.ApiException source)abstract UcreateGoogleAdsFailure()Create an empty GoogleAdsFailure instance for this version.abstract UcreateGoogleAdsFailure(byte[] serializedBytes)protected static io.grpc.Metadata.Key<byte[]>createKey(java.lang.String trailerKey)abstract io.grpc.Metadata.Key<byte[]>getTrailerKey()Returns a Metadata.Key representing the key which the GoogleAdsFailure is returned in the metadata.
-
-
-
Method Detail
-
createKey
protected static io.grpc.Metadata.Key<byte[]> createKey(java.lang.String trailerKey)
-
createGoogleAdsException
public java.util.Optional<T> createGoogleAdsException(com.google.api.gax.rpc.ApiException source)
-
createException
protected abstract T createException(com.google.api.gax.rpc.ApiException source, byte[] protoData, io.grpc.Metadata metadata) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
getTrailerKey
public abstract io.grpc.Metadata.Key<byte[]> getTrailerKey()
Returns a Metadata.Key representing the key which the GoogleAdsFailure is returned in the metadata.
-
createGoogleAdsFailure
public abstract U createGoogleAdsFailure()
Create an empty GoogleAdsFailure instance for this version.
-
createGoogleAdsFailure
public abstract U createGoogleAdsFailure(byte[] serializedBytes) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
-