本文整理汇总了Java中play.libs.Scala.orNull方法的典型用法代码示例。如果您正苦于以下问题:Java Scala.orNull方法的具体用法?Java Scala.orNull怎么用?Java Scala.orNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类play.libs.Scala
的用法示例。
在下文中一共展示了Scala.orNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindings
import play.libs.Scala; //导入方法依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
GlobalParams.AWS_ACCESS_KEY = Scala.orNull(configuration.getString("AWS_ACCESS_KEY", scala.Option.empty()));
GlobalParams.AWS_SECRET_KEY = Scala.orNull(configuration.getString("AWS_SECRET_KEY", scala.Option.empty()));
GlobalParams.AWS_S3_BUCKET = Scala.orNull(configuration.getString("AWS_S3_BUCKET", scala.Option.empty()));
String accessKey = GlobalParams.AWS_ACCESS_KEY;
String secretKey = GlobalParams.AWS_SECRET_KEY;
s3Bucket = GlobalParams.AWS_S3_BUCKET;
if ((accessKey != null) && (secretKey != null)) {
awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
amazonS3 = new AmazonS3Client(awsCredentials);
Logger.info("Using S3 Bucket: " + s3Bucket);
}
return seq(
bind(S3Plugin.class).to(S3PluginImpl.class)
);
}
示例2: plugin
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieve the plugin instance for the class.
*/
public <T> T plugin(Class<T> pluginClass) {
return Scala.orNull(application.plugin(pluginClass));
}
示例3: getString
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>String</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public String getString(String key) {
return Scala.orNull(conf.getString(key, scala.Option.<scala.collection.immutable.Set<java.lang.String>>empty()));
}
示例4: getNanoseconds
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Nanoseconds</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Long getNanoseconds(String key) {
return (Long)Scala.orNull(conf.getNanoseconds(key));
}
示例5: getBytes
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Bytes</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Long getBytes(String key) {
return (Long)Scala.orNull(conf.getBytes(key));
}
示例6: getDouble
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Double</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Double getDouble(String key) {
return (Double)Scala.orNull(conf.getDouble(key));
}
示例7: getInt
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Int</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Integer getInt(String key) {
return (Integer)Scala.orNull(conf.getInt(key));
}
示例8: getLong
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Long</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Long getLong(String key) {
return (Long)Scala.orNull(conf.getLong(key));
}
示例9: getNumber
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as an <code>Number</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Number getNumber(String key) {
return (Number)Scala.orNull(conf.getNumber(key));
}
示例10: getBoolean
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a <code>Boolean</code>.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public Boolean getBoolean(String key) {
return (Boolean)Scala.orNull(conf.getBoolean(key));
}
示例11: getBooleanList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Boolean>}.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public List<Boolean> getBooleanList(String key) {
return (List<Boolean>)Scala.orNull(conf.getBooleanList(key));
}
示例12: 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)
* @return a configuration value or <code>null</code>
*/
public List<Long> getBytesList(String key) {
return (List<Long>)Scala.orNull(conf.getBytesList(key));
}
示例13: getDoubleList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Double>}.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public List<Double> getDoubleList(String key) {
return (List<Double>)Scala.orNull(conf.getDoubleList(key));
}
示例14: getIntList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Integer>}.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public List<Integer> getIntList(String key) {
return (List<Integer>)Scala.orNull(conf.getIntList(key));
}
示例15: getLongList
import play.libs.Scala; //导入方法依赖的package包/类
/**
* Retrieves a configuration value as a {@code List<Long>}.
*
* @param key configuration key (relative to configuration root key)
* @return a configuration value or <code>null</code>
*/
public List<Long> getLongList(String key) {
return (List<Long>)Scala.orNull(conf.getLongList(key));
}