Class BaseView

    • Constructor Detail

      • BaseView

        protected BaseView​(Context backend,
                           com.google.common.reflect.TypeToken<? extends Context> backendType)
    • Method Detail

      • unwrap

        public <C extends Context> C unwrap​(com.google.common.reflect.TypeToken<C> type)
        Description copied from interface: View
        Return an object of the specified type to allow access to the backend context. If the backend context is not assignable from the supplied type, an IllegalArgumentException is thrown. ex.
         ApiContext backendApi = computeContext.unwrap(new TypeToken>(){});
         
        Specified by:
        unwrap in interface View
        Parameters:
        type - the type of the context to be returned. The backend context must be assignable from this type.
        Returns:
        an instance of the specified type
        See Also:
        View.getBackendType()
      • getBackendType

        public com.google.common.reflect.TypeToken<? extends Context> getBackendType()
        Specified by:
        getBackendType in interface View
        Returns:
        type of the context powering the current one.
      • unwrapApi

        public <A extends Closeable> A unwrapApi​(Class<A> apiClass)
        Description copied from interface: View
        Unwraps the underlying api from this view.
        Specified by:
        unwrapApi in interface View
        Parameters:
        apiClass - The class of the api to unwrap.
        Returns:
        The unwrapped api.
      • delegate

        protected Context delegate()
        Specified by:
        delegate in class com.google.common.collect.ForwardingObject
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Overrides:
        toString in class com.google.common.collect.ForwardingObject
      • string

        protected com.google.common.base.MoreObjects.ToStringHelper string()