本文整理汇总了Java中ch.njol.skript.util.Utils.getSuperType方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getSuperType方法的具体用法?Java Utils.getSuperType怎么用?Java Utils.getSuperType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.njol.skript.util.Utils
的用法示例。
在下文中一共展示了Utils.getSuperType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExprJavaCall
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprJavaCall(ExprJavaCall<?> source, Class<? extends T>... types) {
this.source = source;
if (source != null) {
this.targetArg = source.targetArg;
this.args = source.args;
this.type = source.type;
this.suppressErrors = source.suppressErrors;
this.staticDescriptor = source.staticDescriptor;
this.dynamicDescriptor = source.dynamicDescriptor;
}
this.types = types;
this.superType = (Class<T>) Utils.getSuperType(types);
}
示例2: getConvertedExpr
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
protected <R> ConvertedExpression<Object, ? extends R> getConvertedExpr(final Class<R>... to) {
if (isVariableLoop && !isIndex) {
return new ConvertedExpression<Object, R>(this, (Class<R>) Utils.getSuperType(to), new Converter<Object, R>() {
@Override
@Nullable
public R convert(final Object o) {
return Converters.convert(o, to);
}
});
} else {
return super.getConvertedExpr(to);
}
}
示例3: ExprExpression
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprExpression(ExprExpression<?> source, Class<? extends T>... types) {
if (source != null) {
index = source.index;
plural = source.plural;
}
this.source = source;
this.types = types;
this.superType = (Class<T>) Utils.getSuperType(types);
}
示例4: ExpressionHandler
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExpressionHandler(ExpressionHandler<?> source, Class<? extends T>... types) {
this.source = source;
if (source != null) {
this.which = source.which;
this.exprs = source.exprs;
this.parseResult = source.parseResult;
}
this.types = types;
this.superType = (Class<T>) Utils.getSuperType(types);
}
示例5: ExprChangeValue
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprChangeValue(ExprChangeValue<?> source, Class<? extends T>... types) {
if (source != null) {
index = source.index;
plural = source.plural;
}
this.source = source;
this.types = types;
this.superType = (Class<T>) Utils.getSuperType(types);
}
示例6: ExprSpread
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprSpread(ExprSpread<?> source, Class<? extends T>... types) {
this.source = source;
if (source != null) {
this.object = source.object;
}
this.types = types;
this.superType = (Class<T>) Utils.getSuperType(types);
}
示例7: getConvertedExpression
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public <R> Literal<? extends R> getConvertedExpression(final Class<R>... to) {
final Literal<? extends R>[] exprs = new Literal[expressions.length];
final Class<?>[] classes = new Class[expressions.length];
for (int i = 0; i < exprs.length; i++) {
if ((exprs[i] = (Literal<? extends R>) expressions[i].getConvertedExpression(to)) == null)
return null;
classes[i] = exprs[i].getReturnType();
}
return new LiteralList<R>(exprs, (Class<R>) Utils.getSuperType(classes), and, this);
}
示例8: getConvertedExpression
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public <R> Expression<? extends R> getConvertedExpression(final Class<R>... to) {
final Expression<? extends R>[] exprs = new Expression[expressions.length];
for (int i = 0; i < exprs.length; i++)
if ((exprs[i] = expressions[i].getConvertedExpression(to)) == null)
return null;
return new ExpressionList<R>(exprs, (Class<R>) Utils.getSuperType(to), and, this);
}
示例9: getConvertedExpression
import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public <R> Literal<? extends R> getConvertedExpression(final Class<R>... to) {
if (CollectionUtils.containsSuperclass(to, c))
return (Literal<? extends R>) this;
final R[] parsedData = Converters.convertArray(data, to, (Class<R>) Utils.getSuperType(to));
if (parsedData.length != data.length)
return null;
return new ConvertedLiteral<T, R>(this, parsedData, (Class<R>) Utils.getSuperType(to));
}