本文整理汇总了Java中com.beust.jcommander.internal.Nullable类的典型用法代码示例。如果您正苦于以下问题:Java Nullable类的具体用法?Java Nullable怎么用?Java Nullable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Nullable类属于com.beust.jcommander.internal包,在下文中一共展示了Nullable类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: textToBeEqualsToExpectedValue
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
/**
* Expects that the target element contains the given value as text.
* The inner text and 'value' attribute of the element is checked.
*
* @param locator
* is the selenium locator
* @param value
* is the expected value
* @return true or false
*/
public static ExpectedCondition<Boolean> textToBeEqualsToExpectedValue(final By locator, final String value) {
return new ExpectedCondition<Boolean>() {
/**
* {@inheritDoc}
*/
@Override
public Boolean apply(@Nullable WebDriver driver) {
try {
WebElement element = driver.findElement(locator);
if (element != null && value != null) {
if (element.getAttribute(VALUE) == null || !value.equals(element.getAttribute(VALUE).trim())) {
if (!value.equals(element.getText())) {
return false;
}
}
return true;
}
} catch (Exception e) {
}
return false;
}
};
}
示例2: newWindowOpens
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
/**
* @param currentHandles
* is list of opened windows.
* @return a string with new Window Opens (GUID)
*/
public static ExpectedCondition<String> newWindowOpens(final Set<String> currentHandles) {
return new ExpectedCondition<String>() {
/**
* {@inheritDoc}
*/
@Override
public String apply(@Nullable WebDriver driver) {
if (driver != null && !currentHandles.equals(driver.getWindowHandles())) {
for (String s : driver.getWindowHandles()) {
if (!currentHandles.contains(s)) {
return s;
}
}
}
return null;
}
};
}
示例3: Client
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
public Client(
ClientType clientType,
String networkAddress,
String project,
@Nullable String subscription,
ScheduledExecutorService executorService,
@Nullable Supplier<LoadtestGrpc.LoadtestStub> stubFactory) {
this.clientType = clientType;
this.networkAddress = networkAddress;
this.clientStatus = ClientStatus.NONE;
this.project = project;
this.topic = TOPIC_PREFIX + getTopicSuffix(clientType);
this.subscription = subscription;
this.executorService = executorService;
this.stubFactory = stubFactory;
}
示例4: JCommander
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
/**
* @param object The arg object expected to contain {@link Parameter} annotations.
* @param bundle The bundle to use for the descriptions. Can be null.
* @param args The arguments to parse (optional).
*/
public JCommander(Object object, @Nullable ResourceBundle bundle, String... args) {
this();
addObject(object);
if (bundle != null) {
setDescriptionsBundle(bundle);
}
createDescriptions();
if (args != null) {
parse(args);
}
}
示例5: XHMMEmissionProbabilityCalculator
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
public XHMMEmissionProbabilityCalculator(final double deletionMean, final double duplicationMean, final double emissionStdDev,
@Nullable final RandomGenerator rng) {
this.deletionMean = ParamUtils.isNegativeOrZero(deletionMean, "Deletion coverage shift must be negative.");
this.duplicationMean = ParamUtils.isPositiveOrZero(duplicationMean, "Duplication coverage shift must be positive");
emissionStandardDeviation = ParamUtils.isPositive(emissionStdDev, "Emission standard deviation must be positive");
this.rng = rng;
}
示例6: sarsaRunFourier
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
public static void sarsaRunFourier(
final double discount, final String name, final int order, final double learningRate, final double lambda,
NormalizedVariableFeatures inputFeatures, final PrototypeScenario scenario, final Path containerPath,
final Steppable additionalSteppable, final double initialEpsilon, @Nullable Pair<ShodanStateOil,Action> baseline,
String... featureNames) throws IOException, NoSuchFieldException, IllegalAccessException {
//write a YAML for the results
HashMap<String,Object> resultObject = new HashMap<>();
resultObject.put("method","sarsa");
resultObject.put("lambda",lambda);
resultObject.put("discount",discount);
resultObject.put("learning_rate",learningRate);
resultObject.put("factors",featureNames);
resultObject.put("name",name);
resultObject.put("base","fourier");
resultObject.put("order",order);
resultObject.put("initial_epsilon", initialEpsilon);
resultObject.put("normalized",true);
resultObject.put("baseline", baseline != null);
//run sarsa, return last fitness
double fitness = runSarsa(new FourierBasis(inputFeatures, order), name, discount, learningRate, lambda,
containerPath, scenario,baseline, resultObject, initialEpsilon);
double bestFitness = fitness;
if(resultObject.containsKey("fitness"))
bestFitness = Math.max(bestFitness, (Double) resultObject.get("fitness"));
resultObject.put("fitness",bestFitness);
resultObject.put("episodes",NUMBER_OF_EPISODES);
//to file
File yamlFile = containerPath.resolve("results").resolve(name + ".yaml").toFile();
Yaml yaml = new Yaml();
yaml.dump(resultObject,new FileWriter(yamlFile));
}
示例7: sarsaRunFourier
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
public static void sarsaRunFourier(
final double discount, final String name, final int order, final double learningRate, final double lambda,
NormalizedVariableFeatures inputFeatures, final PrototypeScenario scenario, final Path containerPath,
final Steppable additionalSteppable, @Nullable Pair<ShodanStateOil,Action> baseline,
String... featureNames) throws IOException, NoSuchFieldException, IllegalAccessException {
ShodanEnvironment environment = new ShodanEnvironment(scenario, additionalSteppable);
//write a YAML for the results
HashMap<String,Object> resultObject = new HashMap<>();
resultObject.put("method","sarsa");
resultObject.put("lambda",lambda);
resultObject.put("discount",discount);
resultObject.put("learning_rate",learningRate);
resultObject.put("factors",featureNames);
resultObject.put("name",name);
resultObject.put("base","fourier");
resultObject.put("order",order);
resultObject.put("normalized",true);
//run sarsa, return last fitness
double fitness = runSarsa(new FourierBasis(inputFeatures, order), name, discount, learningRate, lambda,
containerPath, environment,baseline , resultObject);
double bestFitness = fitness;
if(resultObject.containsKey("fitness"))
bestFitness = Math.max(bestFitness, (Double) resultObject.get("fitness"));
resultObject.put("fitness",bestFitness);
resultObject.put("episodes",NUMBER_OF_EPISODES);
//to file
File yamlFile = containerPath.resolve("results").resolve(name + ".yaml").toFile();
Yaml yaml = new Yaml();
yaml.dump(resultObject,new FileWriter(yamlFile));
}
示例8: JCommander
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
/**
* @param object The arg object expected to contain {@link Parameter} annotations.
* @param bundle The bundle to use for the descriptions. Can be null.
*/
public JCommander(Object object, @Nullable ResourceBundle bundle) {
addObject(object);
setDescriptionsBundle(bundle);
}
示例9: JCommander
import com.beust.jcommander.internal.Nullable; //导入依赖的package包/类
/**
* @param object The arg object expected to contain {@link Parameter} annotations.
* @param bundle The bundle to use for the descriptions. Can be null.
*/
public JCommander(Object object, @Nullable ResourceBundle bundle) {
addObject(object);
setDescriptionsBundle(bundle);
}