本文整理匯總了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--------------------";
}