本文整理汇总了Java中play.libs.Scala.orElse方法的典型用法代码示例。如果您正苦于以下问题:Java Scala.orElse方法的具体用法?Java Scala.orElse怎么用?Java Scala.orElse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类play.libs.Scala
的用法示例。
在下文中一共展示了Scala.orElse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getString
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>String</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultString default value if configuration key doesn't exist
* @return a configuration value or the defaultString
*/
public String getString(String key, String defaultString) {
return Scala.orElse(conf.getString(key, scala.Option.<scala.collection.immutable.Set<java.lang.String>>empty()), defaultString);
}
示例2: getMilliseconds
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Milliseconds</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultMilliseconds default value if configuration key doesn't exist
* @return a configuration value or the defaultMilliseconds
*/
public Long getMilliseconds(String key, Long defaultMilliseconds) {
return (Long)Scala.orElse(conf.getMilliseconds(key), defaultMilliseconds);
}
示例3: getNanoseconds
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Nanoseconds</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultNanoseconds default value if configuration key doesn't exist
* @return a configuration value or the defaultMilliseconds
*/
public Long getNanoseconds(String key, Long defaultNanoseconds) {
return (Long)Scala.orElse(conf.getNanoseconds(key), defaultNanoseconds);
}
示例4: getBytes
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Bytes</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultBytes default value if configuration key doesn't exist
* @return a configuration value or the defaultBytes
*/
public Long getBytes(String key, Long defaultBytes) {
return (Long)Scala.orElse(conf.getBytes(key), defaultBytes);
}
示例5: getDouble
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Double</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultDouble default value if configuration key doesn't exist
* @return a configuration value or the defaultInteger
*/
public Double getDouble(String key, Double defaultDouble) {
return (Double)Scala.orElse(conf.getDouble(key), defaultDouble);
}
示例6: getInt
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Int</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultInteger default value if configuration key doesn't exist
* @return a configuration value or the defaultInteger
*/
public Integer getInt(String key, Integer defaultInteger) {
return (Integer)Scala.orElse(conf.getInt(key), defaultInteger);
}
示例7: getLong
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Long</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultLong default value if configuration key doesn't exist
* @return a configuration value or the defaultInteger
*/
public Long getLong(String key, Long defaultLong) {
return (Long)Scala.orElse(conf.getLong(key), defaultLong);
}
示例8: getNumber
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Number</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultNumber default value if configuration key doesn't exist
* @return a configuration value or the defaultInteger
*/
public Number getNumber(String key, Number defaultNumber) {
return (Number)Scala.orElse(conf.getNumber(key), defaultNumber);
}
示例9: getBoolean
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Boolean</code>.
*
* @param key configuration key (relative to configuration root key)
* @param defaultBoolean default value if configuration key doesn't exist
* @return a configuration value or the defaultBoolean
*/
public Boolean getBoolean(String key, Boolean defaultBoolean) {
return (Boolean)Scala.orElse(conf.getBoolean(key), defaultBoolean);
}
示例10: getBooleanList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Boolean>}.
*
* @param key configuration key (relative to configuration root key)
* @param defaultList default value if configuration key doesn't exist
* @return a configuration value or the defaultList
*/
public List<Boolean> getBooleanList(String key, List<Boolean> defaultList) {
return (List<Boolean>)Scala.orElse(conf.getBooleanList(key), defaultList);
}
示例11: getBytesList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Long>} representing bytes.
*
* @param key configuration key (relative to configuration root key)
* @param defaultList default value if configuration key doesn't exist
* @return a configuration value or the defaultList
*/
public List<Long> getBytesList(String key, List<Long> defaultList) {
return (List<Long>)Scala.orElse(conf.getBytesList(key), defaultList);
}
示例12: getDoubleList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Double>}.
*
* @param key configuration key (relative to configuration root key)
* @param defaultList default value if configuration key doesn't exist
* @return a configuration value or the defaultList
*/
public List<Double> getDoubleList(String key, List<Double> defaultList) {
return (List<Double>)Scala.orElse(conf.getDoubleList(key), defaultList);
}
示例13: getIntList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Integer>}.
*
* @param key configuration key (relative to configuration root key)
* @param defaultList default value if configuration key doesn't exist
* @return a configuration value or the defaultList
*/
public List<Integer> getIntList(String key, List<Integer> defaultList) {
return (List<Integer>)Scala.orElse(conf.getIntList(key), defaultList);
}
示例14: getLongList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Long>}.
*
* @param key configuration key (relative to configuration root key)
* @param defaultList default value if configuration key doesn't exist
* @return a configuration value or the defaultList
*/
public List<Long> getLongList(String key, List<Long> defaultList) {
return (List<Long>)Scala.orElse(conf.getLongList(key), defaultList);
}
示例15: getMillisecondsList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Long>} representing Milliseconds.
*
* @param key configuration key (relative to configuration root key)
* @param defaultList default value if configuration key doesn't exist
* @return a configuration value or the defaultList
*/
public List<Long> getMillisecondsList(String key, List<Long> defaultList) {
return (List<Long>)Scala.orElse(conf.getMillisecondsList(key), defaultList);
}