本文整理汇总了Java中ch.njol.util.coll.CollectionUtils类的典型用法代码示例。如果您正苦于以下问题:Java CollectionUtils类的具体用法?Java CollectionUtils怎么用?Java CollectionUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionUtils类属于ch.njol.util.coll包,在下文中一共展示了CollectionUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.DELETE) {
return CollectionUtils.array(Object.class);
}
switch (ty) {
case 0: {
if (mode == Changer.ChangeMode.SET) {
return CollectionUtils.array(Object.class);
}
break;
}
case 1:
case 2:
case 3:
if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.REMOVE) {
return CollectionUtils.array(Object.class);
}
break;
}
return null;
}
示例2: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.DELETE && (type.acceptChange & ~PLAYER) != 0 || mode == ChangeMode.RESET)
return new Class[0];
if (mode != ChangeMode.SET)
return null;
if ((type.acceptChange & PLAYER) != 0 && Player.class.isAssignableFrom(getExpr().getReturnType())) {
changeType = PLAYER;
} else if ((type.acceptChange & ITEMSTACK) != 0 && (getExpr().isSingle() && ChangerUtils.acceptsChange(getExpr(), ChangeMode.SET, ItemStack.class, ItemType.class) || Slot.class.isAssignableFrom(getExpr().getReturnType()))) {
changeType = ITEMSTACK;
} else if ((type.acceptChange & ENTITY) != 0 && LivingEntity.class.isAssignableFrom(getExpr().getReturnType())) {
if (type == NameType.NAME && Player.class.isAssignableFrom(getExpr().getReturnType())) {
Skript.error("Cannot change the Minecraft name of a player. Change the 'display name of <player>' or 'tablist name of <player>' instead.");
return null;
}
changeType = ENTITY;
}
return changeType == 0 ? null : CollectionUtils.array(String.class);
}
示例3: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.DELETE || mode == Changer.ChangeMode.RESET) {
return CollectionUtils.array(Object.class);
}
if (state == States.VALUE) {
if (mode == Changer.ChangeMode.SET) {
return CollectionUtils.array(Object.class);
}
} else if (state == States.LIST) {
if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.REMOVE) {
return CollectionUtils.array(Object.class);
}
}
return null;
}
示例4: get
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@NotNull
@Override
protected ItemStack[] get(Event event) {
ItemStack banner = new ItemStack(type);
BannerMeta meta = (BannerMeta) banner.getItemMeta();
meta.setBaseColor(CollectionUtils.getRandom(DyeColor.values()));
for (int i = 0; i < new Random().nextInt(7); i++)
meta.addPattern(new Pattern(CollectionUtils.getRandom(DyeColor.values()),
CollectionUtils.getRandom(PatternType.values())
));
banner.setItemMeta(meta);
return new ItemStack[]{banner};
}
示例5: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.DELETE || mode == Changer.ChangeMode.RESET) {
return CollectionUtils.array(Pattern.class);
} else if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.SET) {
return CollectionUtils.array(Pattern[].class);
}
return null;
}
示例6: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.DELETE || mode == Changer.ChangeMode.RESET) {
return CollectionUtils.array(Pattern.class);
} else if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.SET) {
return CollectionUtils.array(Pattern[].class);
} else {
return null;
}
}
示例7: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
return (mode == Changer.ChangeMode.SET || mode == Changer.ChangeMode.RESET)
? CollectionUtils.array(Color.class)
: null;
}
示例8: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode != Changer.ChangeMode.REMOVE && mode != Changer.ChangeMode.REMOVE_ALL
&& mode != Changer.ChangeMode.ADD) {
return CollectionUtils.array(PotionEffectType.class);
}
return null;
}
示例9: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode != Changer.ChangeMode.REMOVE && mode != Changer.ChangeMode.REMOVE_ALL) {
return CollectionUtils.array(PotionEffect[].class);
} else {
return CollectionUtils.array(PotionEffectType[].class);
}
}
示例10: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.REMOVE) {
return CollectionUtils.array(PotionEffectType.class);
} else if (mode != Changer.ChangeMode.RESET) {
return CollectionUtils.array(PotionEffect[].class);
}
return null;
}
示例11: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode != Changer.ChangeMode.REMOVE_ALL && mode != Changer.ChangeMode.RESET
&& mode != Changer.ChangeMode.DELETE) {
return CollectionUtils.array(Number.class);
}
return null;
}
示例12: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
if (mode != Changer.ChangeMode.REMOVE_ALL && mode != Changer.ChangeMode.RESET
&& mode != Changer.ChangeMode.DELETE) {
return CollectionUtils.array(Timespan.class);
}
return null;
}
示例13: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final ChangeMode mode) {
if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.RESET) {
return CollectionUtils.array(String.class);
}
return null;
}
示例14: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(ItemType.class);
}
return null;
}
示例15: acceptChange
import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(Location.class);
}
return null;
}