hudson.Functions.getTypeParameter()方法的使用及代码示例

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

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

Functions.getTypeParameter介绍

[英]Given c=MyList (extends ArrayList), base=List, compute the parameterization of 'base' that's assignable from 'c' (in this case List), and return its n-th type parameter (n=0 would return Foo).

This method is useful for doing type arithmetic.
[中]给定c=MyList(extends ArrayList),base=List,计算可从“c”(在本例中为List)赋值的“base”的参数化,并返回其第n个类型参数(n=0将返回Foo)。
此方法对于执行类型算术非常有用。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Infer the type parameterization 'P'
 */
private Class<P> getP() {
  return Functions.getTypeParameter(getClass(),Descriptor.class,0);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns true if this property type is applicable to the
 * given target type.
 *
 * <p>
 * The default implementation of this method checks if the given node type is assignable
 * according to the parameterization, but subtypes can extend this to change this behavior.
 *
 * @return
 *      true to indicate applicable, in which case the property will be
 *      displayed in the configuration screen of the target, for example.
 */
public boolean isApplicable(Class<? extends T> targetType) {
  Class<? extends T> applicable = Functions.getTypeParameter(clazz,getP(),0);
  return applicable.isAssignableFrom(targetType);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Infer the type parameterization 'P'
 */
private Class<P> getP() {
  return Functions.getTypeParameter(getClass(),Descriptor.class,0);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Infer the type parameterization 'P'
 */
private Class<P> getP() {
  return Functions.getTypeParameter(getClass(),Descriptor.class,0);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Infer the type parameterization 'P'
 */
private Class<P> getP() {
  return Functions.getTypeParameter(getClass(),Descriptor.class,0);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Infer the type parameterization 'P'
 */
private Class<P> getP() {
  return Functions.getTypeParameter(getClass(),Descriptor.class,0);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Infer the type parameterization 'P'
 */
private Class<P> getP() {
  return Functions.getTypeParameter(getClass(), Descriptor.class, 0);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Returns true if this property type is applicable to the
 * given target type.
 *
 * <p>
 * The default implementation of this method checks if the given node type is assignable
 * according to the parameterization, but subtypes can extend this to change this behavior.
 *
 * @return
 *      true to indicate applicable, in which case the property will be
 *      displayed in the configuration screen of the target, for example.
 */
public boolean isApplicable(Class<? extends T> targetType) {
  Class<? extends T> applicable = Functions.getTypeParameter(clazz,getP(),0);
  return applicable.isAssignableFrom(targetType);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns true if this property type is applicable to the
 * given target type.
 *
 * <p>
 * The default implementation of this method checks if the given node type is assignable
 * according to the parameterization, but subtypes can extend this to change this behavior.
 *
 * @return
 *      true to indicate applicable, in which case the property will be
 *      displayed in the configuration screen of the target, for example.
 */
public boolean isApplicable(Class<? extends T> targetType) {
  Class<? extends T> applicable = Functions.getTypeParameter(clazz,getP(),0);
  return applicable.isAssignableFrom(targetType);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns true if this property type is applicable to the given target
 * type.
 *
 * <p> The default implementation of this method checks if the given node
 * type is assignable according to the parameterization, but subtypes can
 * extend this to change this behavior.
 *
 * @return true to indicate applicable, in which case the property will be
 * displayed in the configuration screen of the target, for example.
 */
public boolean isApplicable(Class<? extends T> targetType) {
  Class<? extends T> applicable = Functions.getTypeParameter(clazz, getP(), 0);
  return applicable.isAssignableFrom(targetType);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Returns true if this property type is applicable to the
 * given target type.
 *
 * <p>
 * The default implementation of this method checks if the given node type is assignable
 * according to the parameterization, but subtypes can extend this to change this behavior.
 *
 * @return
 *      true to indicate applicable, in which case the property will be
 *      displayed in the configuration screen of the target, for example.
 */
public boolean isApplicable(Class<? extends T> targetType) {
  Class<? extends T> applicable = Functions.getTypeParameter(clazz,getP(),0);
  return applicable.isAssignableFrom(targetType);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Returns true if this property type is applicable to the
 * given target type.
 *
 * <p>
 * The default implementation of this method checks if the given node type is assignable
 * according to the parameterization, but subtypes can extend this to change this behavior.
 *
 * @return
 *      true to indicate applicable, in which case the property will be
 *      displayed in the configuration screen of the target, for example.
 */
public boolean isApplicable(Class<? extends T> targetType) {
  Class<? extends T> applicable = Functions.getTypeParameter(clazz,getP(),0);
  return applicable.isAssignableFrom(targetType);
}

相关文章

微信公众号

最新文章

更多