org.eclipse.lsp4j.jsonrpc.messages.Either.isEither()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(99)

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

Either.isEither介绍

[英]Test whether the given class is Either.
[中]测试给定的类是否为。

代码示例

代码示例来源:origin: org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc

/**
 * Test whether the given type is Either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#isEither(Type)} instead
 */
@Deprecated
public static boolean isEither(Type type) {
  if (type instanceof ParameterizedType) {
    return isEither((ParameterizedType) type);
  }
  if (type instanceof Class) {
    return isEither((Class<?>) type);
  }
  return false;
}

代码示例来源:origin: eclipse/lsp4j

/**
 * Test whether the given type is Either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#isEither(Type)} instead
 */
@Deprecated
public static boolean isEither(Type type) {
  if (type instanceof ParameterizedType) {
    return isEither((ParameterizedType) type);
  }
  if (type instanceof Class) {
    return isEither((Class<?>) type);
  }
  return false;
}

代码示例来源:origin: org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc

/**
 * Test whether the given type is Either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#isEither(Type)} instead
 */
@Deprecated
public static boolean isEither(ParameterizedType type) {
  return isEither(type.getRawType());
}

代码示例来源:origin: eclipse/lsp4j

/**
 * Test whether the given type is Either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#isEither(Type)} instead
 */
@Deprecated
public static boolean isEither(ParameterizedType type) {
  return isEither(type.getRawType());
}

代码示例来源:origin: org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc

/**
 * Return a left disjoint type if the given type is either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#getElementTypes(Type, Class, Class)} instead
 */
@Deprecated
public static Type getLeftDisjointType(Type type) {
  if (isEither(type)) {
    if (type instanceof ParameterizedType) {
      final ParameterizedType parameterizedType = (ParameterizedType) type;
      return parameterizedType.getActualTypeArguments()[0];
    }
    if (type instanceof Class) {
      final Class<?> cls = (Class<?>) type;
      return cls.getTypeParameters()[0];
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc

/**
 * Return a right disjoint type if the given type is either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#getElementTypes(Type, Class, Class)} instead
 */
@Deprecated
public static Type getRightDisjointType(Type type) {
  if (isEither(type)) {
    if (type instanceof ParameterizedType) {
      final ParameterizedType parameterizedType = (ParameterizedType) type;
      return parameterizedType.getActualTypeArguments()[1];
    }
    if (type instanceof Class) {
      final Class<?> cls = (Class<?>) type;
      return cls.getTypeParameters()[1];
    }
  }
  return null;
}

代码示例来源:origin: eclipse/lsp4j

/**
 * Return a left disjoint type if the given type is either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#getElementTypes(Type, Class, Class)} instead
 */
@Deprecated
public static Type getLeftDisjointType(Type type) {
  if (isEither(type)) {
    if (type instanceof ParameterizedType) {
      final ParameterizedType parameterizedType = (ParameterizedType) type;
      return parameterizedType.getActualTypeArguments()[0];
    }
    if (type instanceof Class) {
      final Class<?> cls = (Class<?>) type;
      return cls.getTypeParameters()[0];
    }
  }
  return null;
}

代码示例来源:origin: eclipse/lsp4j

/**
 * Return a right disjoint type if the given type is either.
 * 
 * @deprecated Use {@link org.eclipse.lsp4j.jsonrpc.json.adapters.TypeUtils#getElementTypes(Type, Class, Class)} instead
 */
@Deprecated
public static Type getRightDisjointType(Type type) {
  if (isEither(type)) {
    if (type instanceof ParameterizedType) {
      final ParameterizedType parameterizedType = (ParameterizedType) type;
      return parameterizedType.getActualTypeArguments()[1];
    }
    if (type instanceof Class) {
      final Class<?> cls = (Class<?>) type;
      return cls.getTypeParameters()[1];
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc

@Deprecated
protected static Collection<Type> collectDisjoinTypes(Type type, Collection<Type> types) {
  if (isEither(type)) {
    if (type instanceof ParameterizedType) {
      return collectDisjoinTypes((ParameterizedType) type, types);
    }
    if (type instanceof Class) {
      return collectDisjoinTypes((Class<?>) type, types);
    }
  }
  types.add(type);
  return types;
}

代码示例来源:origin: eclipse/lsp4j

@Deprecated
protected static Collection<Type> collectDisjoinTypes(Type type, Collection<Type> types) {
  if (isEither(type)) {
    if (type instanceof ParameterizedType) {
      return collectDisjoinTypes((ParameterizedType) type, types);
    }
    if (type instanceof Class) {
      return collectDisjoinTypes((Class<?>) type, types);
    }
  }
  types.add(type);
  return types;
}

相关文章