Codota Logo
BindRestContextWithWildcardExtendsExplicitAndRawType
Code IndexAdd Codota to your IDE (free)

How to use
BindRestContextWithWildcardExtendsExplicitAndRawType
in
org.jclouds.config

Best Java code snippets using org.jclouds.config.BindRestContextWithWildcardExtendsExplicitAndRawType (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.jclouds/jclouds-core

static void addRestContextBinding(ApiMetadata apiMetadata, List<Module> modules) {
 if (apiMetadata instanceof HttpApiMetadata) {
   try {
    modules
       .add(new BindApiContextWithWildcardExtendsExplicitAndRawType(HttpApiMetadata.class.cast(apiMetadata)));
   } catch (IllegalArgumentException ignored) {
   }
 } else if (apiMetadata instanceof RestApiMetadata) {
   try {
    modules.add(new BindRestContextWithWildcardExtendsExplicitAndRawType(RestApiMetadata.class
       .cast(apiMetadata)));
   } catch (IllegalArgumentException ignored) {
   }
 }
}
origin: jclouds/legacy-jclouds

  @SuppressWarnings("unchecked")
  @Override
  protected void configure() {
   TypeToken<?> concreteType = BaseRestApiMetadata.contextToken(typeToken(restApiMetadata.getApi()),
      typeToken(restApiMetadata.getAsyncApi()));
   // bind explicit type
   bind(TypeLiteral.get(concreteType.getType())).to(
      TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
         restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
   // bind potentially wildcard type
   if (!concreteType.equals(restApiMetadata.getContext())) {
     bind(TypeLiteral.get(restApiMetadata.getContext().getType())).to(
        TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
           restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
   }
   // bind w/o types
   bind(TypeLiteral.get(RestContext.class)).to(
      TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
         restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
  }
}
origin: io.cloudsoft.jclouds/jclouds-core

  @SuppressWarnings("unchecked")
  @Override
  protected void configure() {
   TypeToken<?> concreteType = BaseRestApiMetadata.contextToken(typeToken(restApiMetadata.getApi()),
      typeToken(restApiMetadata.getAsyncApi()));
   // bind explicit type
   bind(TypeLiteral.get(concreteType.getType())).to(
      TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
         restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
   // bind potentially wildcard type
   if (!concreteType.equals(restApiMetadata.getContext())) {
     bind(TypeLiteral.get(restApiMetadata.getContext().getType())).to(
        TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
           restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
   }
   // bind w/o types
   bind(TypeLiteral.get(RestContext.class)).to(
      TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
         restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
  }
}
origin: jclouds/legacy-jclouds

static void addRestContextBinding(ApiMetadata apiMetadata, List<Module> modules) {
 if (apiMetadata instanceof HttpApiMetadata) {
   try {
    modules
       .add(new BindApiContextWithWildcardExtendsExplicitAndRawType(HttpApiMetadata.class.cast(apiMetadata)));
   } catch (IllegalArgumentException ignored) {
   }
 } else if (apiMetadata instanceof RestApiMetadata) {
   try {
    modules.add(new BindRestContextWithWildcardExtendsExplicitAndRawType(RestApiMetadata.class
       .cast(apiMetadata)));
   } catch (IllegalArgumentException ignored) {
   }
 }
}
origin: org.jclouds/jclouds-core

  @SuppressWarnings("unchecked")
  @Override
  protected void configure() {
   TypeToken<?> concreteType = BaseRestApiMetadata.contextToken(typeToken(restApiMetadata.getApi()),
      typeToken(restApiMetadata.getAsyncApi()));
   // bind explicit type
   bind(TypeLiteral.get(concreteType.getType())).to(
      TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
         restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
   // bind potentially wildcard type
   if (!concreteType.equals(restApiMetadata.getContext())) {
     bind(TypeLiteral.get(restApiMetadata.getContext().getType())).to(
        TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
           restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
   }
   // bind w/o types
   bind(TypeLiteral.get(RestContext.class)).to(
      TypeLiteral.class.cast(TypeLiteral.get(Types.newParameterizedType(RestContextImpl.class,
         restApiMetadata.getApi(), restApiMetadata.getAsyncApi()))));
  }
}
origin: io.cloudsoft.jclouds/jclouds-core

static void addRestContextBinding(ApiMetadata apiMetadata, List<Module> modules) {
 if (apiMetadata instanceof HttpApiMetadata) {
   try {
    modules
       .add(new BindApiContextWithWildcardExtendsExplicitAndRawType(HttpApiMetadata.class.cast(apiMetadata)));
   } catch (IllegalArgumentException ignored) {
   }
 } else if (apiMetadata instanceof RestApiMetadata) {
   try {
    modules.add(new BindRestContextWithWildcardExtendsExplicitAndRawType(RestApiMetadata.class
       .cast(apiMetadata)));
   } catch (IllegalArgumentException ignored) {
   }
 }
}
origin: jclouds/legacy-jclouds

private Injector injectorFor(ProviderMetadata md) {
 return Guice.createInjector(
      new BindNameToContext("test"),
      new BindProviderMetadataContextAndCredentials(md, ofInstance(new Credentials("user", "pass"))),
      new BindRestContextWithWildcardExtendsExplicitAndRawType(RestApiMetadata.class.cast(md
               .getApiMetadata())),
                     // stuff needed for RestContextImpl
      new MockModule(),
      new AbstractModule() {
       
       @Override
       protected void configure() {
         bind(Utils.class).toInstance(createMock(Utils.class));
         bind(IntegrationTestClient.class).toInstance(createMock(IntegrationTestClient.class));
         bind(IntegrationTestAsyncClient.class).toInstance(createMock(IntegrationTestAsyncClient.class));
       }
      });
}
org.jclouds.configBindRestContextWithWildcardExtendsExplicitAndRawType

Javadoc

Allows you to lookup the RestApiMetadata#getContext() as RestContext, RestContext, and author Adrian Cole

Most used methods

  • <init>
  • bind

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • BoxLayout (javax.swing)
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now