org.apache.http.conn.scheme.Scheme.getName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.apache.http.conn.scheme.Scheme.getName()方法的一些代码示例,展示了Scheme.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheme.getName()方法的具体详情如下:
包路径:org.apache.http.conn.scheme.Scheme
类名称:Scheme
方法名:getName

Scheme.getName介绍

[英]Obtains the scheme name.
[中]获取方案名称。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          <code>null</code> if none was registered
 */
public synchronized final Scheme register(Scheme sch) {
  if (sch == null)
    throw new IllegalArgumentException("Scheme must not be null.");
  Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: k9mail/k-9

@Test
public void checkSettings_shouldRegisterHttpsSchemeWithRegistry() throws Exception {
  configureHttpResponses(UNAUTHORIZED_401_RESPONSE, OK_200_RESPONSE);
  webDavStore.checkSettings();
  ArgumentCaptor<Scheme> schemeCaptor = ArgumentCaptor.forClass(Scheme.class);
  verify(mockSchemeRegistry).register(schemeCaptor.capture());
  assertEquals("https", schemeCaptor.getValue().getName());
  assertEquals(WebDavSocketFactory.class, schemeCaptor.getValue().getSocketFactory().getClass());
}

代码示例来源:origin: robovm/robovm

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
     ") must have layered socket factory.");

代码示例来源:origin: MobiVM/robovm

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          <code>null</code> if none was registered
 */
public synchronized final Scheme register(Scheme sch) {
  if (sch == null)
    throw new IllegalArgumentException("Scheme must not be null.");
  Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          <code>null</code> if none was registered
 */
public synchronized final Scheme register(Scheme sch) {
  if (sch == null)
    throw new IllegalArgumentException("Scheme must not be null.");
  Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          <code>null</code> if none was registered
 */
public synchronized final Scheme register(Scheme sch) {
  if (sch == null)
    throw new IllegalArgumentException("Scheme must not be null.");
  Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          <code>null</code> if none was registered
 */
public synchronized final Scheme register(Scheme sch) {
  if (sch == null)
    throw new IllegalArgumentException("Scheme must not be null.");
  Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: stackoverflow.com

class SchemeAdapter extends ArrayAdapter<Storable> {

  private final transient List<Storable> schemes;
  private final transient int layout;

  public SchemeAdapter(final Context context, final List<Storable> objects) {
    super(context, R.layout.list_row_choose_schedule,
        R.id.list_row_name_of_schedule, objects);

    layout = R.layout.list_row_choose_schedule;
    this.schemes = objects;
  }

  @Override
  public View getView(final int position, final View convertView,
      final ViewGroup parent) {
    final View row = (convertView == null) ? getLayoutInflater()
        .inflate(layout, parent, false) : convertView;

    final TextView name = (TextView) row
        .findViewById(R.id.list_row_name_of_schedule);
    //can be replaced with (Scheme) getItem(position) or sth like that
    final Scheme Scheme = (Scheme) schemes.get(position);
    name.setText(Scheme.getName());

    return row;
  }

}

代码示例来源:origin: ibinti/bugvm

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          {@code null} if none was registered
 */
public final Scheme register(final Scheme sch) {
  Args.notNull(sch, "Scheme");
  final Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: com.hynnet/httpclient

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          {@code null} if none was registered
 */
public final Scheme register(final Scheme sch) {
  Args.notNull(sch, "Scheme");
  final Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          {@code null} if none was registered
 */
public final Scheme register(final Scheme sch) {
  Args.notNull(sch, "Scheme");
  final Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          <code>null</code> if none was registered
 */
public final Scheme register(final Scheme sch) {
  Args.notNull(sch, "Scheme");
  final Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          {@code null} if none was registered
 */
public final Scheme register(final Scheme sch) {
  Args.notNull(sch, "Scheme");
  final Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Registers a scheme.
 * The scheme can later be retrieved by its name
 * using {@link #getScheme(String) getScheme} or {@link #get get}.
 *
 * @param sch       the scheme to register
 *
 * @return  the scheme previously registered with that name, or
 *          {@code null} if none was registered
 */
public final Scheme register(final Scheme sch) {
  Args.notNull(sch, "Scheme");
  final Scheme old = registeredSchemes.put(sch.getName(), sch);
  return old;
}

代码示例来源:origin: soundcloud/java-api-wrapper

/**
 * @param proxy the proxy to use for the wrapper, or null to clear the current one.
 */
public void setProxy(URI proxy) {
  final HttpHost host;
  if (proxy != null) {
    Scheme scheme = getHttpClient()
      .getConnectionManager()
      .getSchemeRegistry()
      .getScheme(proxy.getScheme());
    host = new HttpHost(proxy.getHost(), scheme.resolvePort(proxy.getPort()), scheme.getName());
  } else {
    host = null;
  }
  getHttpClient().getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, host);
}

代码示例来源:origin: MobiVM/robovm

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
     ") must have layered socket factory.");

代码示例来源:origin: FlexoVM/flexovm

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
     ") must have layered socket factory.");

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
     ") must have layered socket factory.");

代码示例来源:origin: com.gluonhq/robovm-rt

if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
  throw new IllegalArgumentException
    ("Target scheme (" + schm.getName() +
     ") must have layered socket factory.");

相关文章