/** * {@inheritDoc} */ @Override public boolean apply(ApiMetadata apiMetadata) { return type.isAssignableFrom(apiMetadata.getContext()); }
/** * {@inheritDoc} */ @Override public boolean apply(ApiMetadata apiMetadata) { return TypeTokenUtils.isSupertypeOf(type, apiMetadata.getContext()); }
/** * Builds the base context for this api. Note that this may be of type {@link Closer}, if nothing * else was configured via {@link ApiMetadata#getContext()}. Typically, the type returned is * {@link ApiContext} * * @see ApiMetadata#getContext() * @see #build(TypeToken) */ @SuppressWarnings("unchecked") public <C extends Context> C build() { return (C) build(apiMetadata.getContext()); }
/** * Builds the base context for this api. Note that this may be of type {@link Closer}, if nothing * else was configured via {@link ApiMetadata#getContext()}. Typically, the type returned is * {@link RestContext} * * @see ApiMetadata#getContext() * @see #build(TypeToken) */ @SuppressWarnings("unchecked") public <C extends Context> C build() { return (C) build(apiMetadata.getContext()); }
/** * Builds the base context for this api. Note that this may be of type {@link Closer}, if nothing * else was configured via {@link ApiMetadata#getContext()}. Typically, the type returned is * {@link RestContext} * * @see ApiMetadata#getContext() * @see #build(TypeToken) */ @SuppressWarnings("unchecked") public <C extends Context> C build() { return (C) build(apiMetadata.getContext()); }
/** * Builds the base context for this api. Note that this may be of type {@link Closer}, if nothing * else was configured via {@link ApiMetadata#getContext()}. Typically, the type returned is * {@link RestContext} * * @see ApiMetadata#getContext() * @see #build(TypeToken) */ @SuppressWarnings("unchecked") public <C extends Context> C build() { return (C) build(apiMetadata.getContext()); }
/** * {@inheritDoc} */ @Override public boolean apply(ApiMetadata apiMetadata) { return type.isAssignableFrom(apiMetadata.getContext()); }
/** * this will build the {@link ApiMetadata#getContext() context} supported by the current ApiMetadata. */ @SuppressWarnings("unchecked") public <C extends Context> C build(TypeToken<C> contextType) { TypeToken<C> returnType = null; if (contextType.isAssignableFrom(apiMetadata.getContext())) returnType = (TypeToken<C>) apiMetadata.getContext(); else throw new IllegalArgumentException(String.format("api %s not assignable from %s; context: %s", apiMetadata, contextType, apiMetadata.getContext())); return (C) buildInjector().getInstance(Key.get(TypeLiteral.get(returnType.getType()))); }
/** * {@inheritDoc} */ @Override public boolean apply(ApiMetadata apiMetadata) { return type.isAssignableFrom(apiMetadata.getContext()); }
/** * {@inheritDoc} */ @Override public boolean apply(ApiMetadata apiMetadata) { return TypeTokenUtils.isSupertypeOf(type, apiMetadata.getContext()); }
/** * Builds the base context for this api. Note that this may be of type {@link Closer}, if nothing * else was configured via {@link ApiMetadata#getContext()}. Typically, the type returned is * {@link ApiContext} * * @see ApiMetadata#getContext() * @see #build(TypeToken) */ @SuppressWarnings("unchecked") public <C extends Context> C build() { return (C) build(apiMetadata.getContext()); }
/** * this will build the {@link ApiMetadata#getContext() context} supported by the current ApiMetadata. */ @SuppressWarnings("unchecked") public <C extends Context> C build(TypeToken<C> contextType) { TypeToken<C> returnType = null; if (contextType.isAssignableFrom(apiMetadata.getContext())) returnType = (TypeToken<C>) apiMetadata.getContext(); else throw new IllegalArgumentException(String.format("api %s not assignable from %s; context: %s", apiMetadata, contextType, apiMetadata.getContext())); return (C) buildInjector().getInstance(Key.get(TypeLiteral.get(returnType.getType()))); }
/** * this will build the {@link ApiMetadata#getContext() context} supported by the current ApiMetadata. */ @SuppressWarnings("unchecked") public <C extends Context> C build(TypeToken<C> contextType) { TypeToken<C> returnType = null; if (contextType.isAssignableFrom(apiMetadata.getContext())) returnType = (TypeToken<C>) apiMetadata.getContext(); else throw new IllegalArgumentException(String.format("api %s not assignable from %s; context: %s", apiMetadata, contextType, apiMetadata.getContext())); return (C) buildInjector().getInstance(Key.get(TypeLiteral.get(returnType.getType()))); }
/** * this will build the {@link ApiMetadata#getContext() context} supported by the current ApiMetadata. */ @SuppressWarnings("unchecked") public <C extends Context> C build(TypeToken<C> contextType) { TypeToken<C> returnType = null; if (TypeTokenUtils.isSupertypeOf(contextType, apiMetadata.getContext())) returnType = (TypeToken<C>) apiMetadata.getContext(); else throw new IllegalArgumentException(String.format("api %s not assignable from %s; context: %s", apiMetadata, contextType, apiMetadata.getContext())); return (C) buildInjector().getInstance(Key.get(TypeLiteral.get(returnType.getType()))); }
/** * Builds the base context for this api. Note that this may be of type {@link Closer}, if nothing * else was configured via {@link ApiMetadata#getContext()}. Typically, the type returned is * {@link ApiContext} * * @see ApiMetadata#getContext() * @see #build(TypeToken) */ @SuppressWarnings("unchecked") public <C extends Context> C build() { return (C) build(apiMetadata.getContext()); }
public T fromApiMetadata(ApiMetadata in) { return id(in.getId()).views(in.getViews()).name(in.getName()).endpointName(in.getEndpointName()).identityName( in.getIdentityName()).credentialName(in.getCredentialName().orNull()).version(in.getVersion()) .buildVersion(in.getBuildVersion().orNull()).defaultEndpoint(in.getDefaultEndpoint().orNull()) .defaultIdentity(in.getDefaultIdentity().orNull()).defaultCredential( in.getDefaultCredential().orNull()).defaultProperties(in.getDefaultProperties()) .documentation(in.getDocumentation()).context(in.getContext()).defaultModules(in.getDefaultModules()); } }
public T fromApiMetadata(ApiMetadata in) { return id(in.getId()).views(in.getViews()).name(in.getName()).endpointName(in.getEndpointName()).identityName( in.getIdentityName()).credentialName(in.getCredentialName().orNull()).version(in.getVersion()) .buildVersion(in.getBuildVersion().orNull()).defaultEndpoint(in.getDefaultEndpoint().orNull()) .defaultIdentity(in.getDefaultIdentity().orNull()).defaultCredential( in.getDefaultCredential().orNull()).defaultProperties(in.getDefaultProperties()) .documentation(in.getDocumentation()).context(in.getContext()).defaultModules(in.getDefaultModules()); } }
public T fromApiMetadata(ApiMetadata in) { return id(in.getId()).views(in.getViews()).name(in.getName()).endpointName(in.getEndpointName()).identityName( in.getIdentityName()).credentialName(in.getCredentialName().orNull()).version(in.getVersion()) .buildVersion(in.getBuildVersion().orNull()).defaultEndpoint(in.getDefaultEndpoint().orNull()) .defaultIdentity(in.getDefaultIdentity().orNull()).defaultCredential( in.getDefaultCredential().orNull()).defaultProperties(in.getDefaultProperties()) .documentation(in.getDocumentation()).context(in.getContext()).defaultModules(in.getDefaultModules()); } }
public T fromApiMetadata(ApiMetadata in) { return id(in.getId()).views(in.getViews()).name(in.getName()).endpointName(in.getEndpointName()).identityName( in.getIdentityName()).credentialName(in.getCredentialName().orNull()).version(in.getVersion()) .buildVersion(in.getBuildVersion().orNull()).defaultEndpoint(in.getDefaultEndpoint().orNull()) .defaultIdentity(in.getDefaultIdentity().orNull()).defaultCredential( in.getDefaultCredential().orNull()).defaultProperties(in.getDefaultProperties()) .documentation(in.getDocumentation()).context(in.getContext()).defaultModules(in.getDefaultModules()); } }
public T fromApiMetadata(ApiMetadata in) { return id(in.getId()).views(in.getViews()).name(in.getName()).endpointName(in.getEndpointName()).identityName( in.getIdentityName()).credentialName(in.getCredentialName().orNull()).version(in.getVersion()) .buildVersion(in.getBuildVersion().orNull()).defaultEndpoint(in.getDefaultEndpoint().orNull()) .defaultIdentity(in.getDefaultIdentity().orNull()).defaultCredential( in.getDefaultCredential().orNull()).defaultProperties(in.getDefaultProperties()) .documentation(in.getDocumentation()).context(in.getContext()).defaultModules(in.getDefaultModules()); } }