Class BaseGoogleAdsException.Factory<T extends BaseGoogleAdsException,​U extends com.google.protobuf.Message>

  • Enclosing class:
    BaseGoogleAdsException

    public abstract static class BaseGoogleAdsException.Factory<T extends BaseGoogleAdsException,​U extends com.google.protobuf.Message>
    extends java.lang.Object
    Optionally 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 T createException​(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 U createGoogleAdsFailure()
      Create an empty GoogleAdsFailure instance for this version.
      abstract U createGoogleAdsFailure​(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Factory

        public Factory()
    • 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