本文整理汇总了Java中org.diorite.config.annotations.CustomKey类的典型用法代码示例。如果您正苦于以下问题:Java CustomKey类的具体用法?Java CustomKey怎么用?Java CustomKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomKey类属于org.diorite.config.annotations包,在下文中一共展示了CustomKey类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ConfigPropertyTemplateImpl
import org.diorite.config.annotations.CustomKey; //导入依赖的package包/类
public ConfigPropertyTemplateImpl(ConfigTemplate<?> template, Class<T> rawType, Type genericType, String name, Function<Config, T> defaultValueSupplier,
AnnotatedElement annotatedElement)
{
this.template = template;
this.rawType = rawType;
this.genericType = genericType;
this.defaultValueSupplier = defaultValueSupplier;
this.annotatedElement = annotatedElement;
this.originalName = name;
Comment comment = this.annotatedElement.getAnnotation(Comment.class);
if (this.annotatedElement.isAnnotationPresent(CustomKey.class))
{
this.name = this.annotatedElement.getAnnotation(CustomKey.class).value();
}
else if ((comment != null) && ! comment.name().isEmpty())
{
this.name = comment.name();
}
else
{
this.name = name;
}
}
示例2: getMoney
import org.diorite.config.annotations.CustomKey; //导入依赖的package包/类
@Comment("Player money.")
@CustomKey("player-money")
@GroovyValidator(isTrue = "x >= 0", elseThrow = "money ($x) can't be lower than 0.")
@GroovyValidator(isTrue = "x < 100_000", elseThrow = "huh")
default double getMoney()
{
return 0.1;
}
示例3: init
import org.diorite.config.annotations.CustomKey; //导入依赖的package包/类
public void init()
{
Comment comment = this.annotatedElement.getAnnotation(Comment.class);
String key;
if (this.annotatedElement.isAnnotationPresent(CustomKey.class))
{
key = this.annotatedElement.getAnnotation(CustomKey.class).value();
}
else if ((comment != null) && ! comment.name().isEmpty())
{
key = comment.name();
}
else
{
key = this.name;
}
this.initSerializeFunc(key);
if (comment != null)
{
DocumentComments comments = this.template.getComments();
comments.setComment(key, comment.value());
}
this.returnUnmodifiableCollections = this.annotatedElement.isAnnotationPresent(Unmodifiable.class);
}
示例4: getTime
import org.diorite.config.annotations.CustomKey; //导入依赖的package包/类
@CustomKey("time")
@Comment("In minutes.")
default int getTime() {
return 1;
}
示例5: getFooter
import org.diorite.config.annotations.CustomKey; //导入依赖的package包/类
@CustomKey("footer")
default String getFooter() {
return "&8&m--------------------" + "\n&eSklep: &6sklep.nazwaserwera.pl" + "\n&eForum: &6forum.nazwaserwera.pl"
+ "\n&eTS3: &6ts3.nazwaserwera.pl"
+ "\n&8&m--------------------";
}
示例6: getHeader
import org.diorite.config.annotations.CustomKey; //导入依赖的package包/类
@CustomKey("header")
default String getHeader() {
return "&8&m--------------------" + "\n&a&lNAZWASERWERA.PL" + "\n&rSLOGAN SERWERA"
+ "\n&8&m--------------------";
}