io.appium.java_client.android.options.app.IntentOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Java client for Appium Mobile Webdriver
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.appium.java_client.android.options.app;
import io.appium.java_client.remote.options.BaseMapOptionData;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
public class IntentOptions extends BaseMapOptionData {
public IntentOptions() {
super();
}
public IntentOptions(Map options) {
super(options);
}
/**
* An intent action name. Application-specific actions should be prefixed with
* the vendor's package name.
*
* @param action E.g. ACTION_MAIN.
* @return self instance for chaining.
*/
public IntentOptions withAction(String action) {
return assignOptionValue("action", action);
}
/**
* Get the action name.
*
* @return Action name.
*/
public Optional getAction() {
return getOptionValue("action");
}
/**
* Set an intent data URI.
*
* @param data E.g. content://contacts/people/1.
* @return self instance for chaining.
*/
public IntentOptions withData(String data) {
return assignOptionValue("data", data);
}
/**
* Get intent data URI.
*
* @return Intent data URI.
*/
public Optional getData() {
return getOptionValue("data");
}
/**
* Intent MIME type.
*
* @param type E.g. image/png.
* @return self instance for chaining.
*/
public IntentOptions withType(String type) {
return assignOptionValue("type", type);
}
/**
* Get an intent type.
*
* @return Intent type.
*/
public Optional getType() {
return getOptionValue("type");
}
/**
* Set intent categories.
*
* @param categories One or more comma-separated Intent categories.
* @return self instance for chaining.
*/
public IntentOptions withCategories(String categories) {
return assignOptionValue("categories", categories);
}
/**
* Get intent categories.
*
* @return Intent categories.
*/
public Optional getCategories() {
return getOptionValue("categories");
}
/**
* Set intent component name with package name prefix
* to create an explicit intent.
*
* @param component E.g. com.example.app/.ExampleActivity.
* @return self instance for chaining.
*/
public IntentOptions withComponent(String component) {
return assignOptionValue("component", component);
}
/**
* Get intent component name.
*
* @return Intent component name.
*/
public Optional getComponent() {
return getOptionValue("component");
}
/**
* Single-string value, which represents intent flags set encoded into
* an integer. Could also be provided in hexadecimal format. Check
* https://developer.android.com/reference/android/content/Intent.html#setFlags(int)
* for more details.
*
* @param intFlags E.g. 0x0F.
* @return self instance for chaining.
*/
public IntentOptions withIntFlags(String intFlags) {
return assignOptionValue("intFlags", intFlags);
}
/**
* Get intent flags.
*
* @return Intent flags encoded into a hexadecimal value.
*/
public Optional getIntFlags() {
return getOptionValue("intFlags");
}
/**
* Comma-separated string of intent flag names.
*
* @param flags E.g. 'ACTIVITY_CLEAR_TASK' (the 'FLAG_' prefix is optional).
* @return self instance for chaining.
*/
public IntentOptions withFlags(String flags) {
return assignOptionValue("flags", flags);
}
/**
* Get intent flag names.
*
* @return Comma-separated string of intent flag names.
*/
public Optional getFlags() {
return getOptionValue("flags");
}
/**
* The name of a class inside of the application package that
* will be used as the component for this Intent.
*
* @param className E.g. com.example.app.MainActivity.
* @return self instance for chaining.
*/
public IntentOptions withClassName(String className) {
return assignOptionValue("className", className);
}
/**
* Get class name.
*
* @return Class name.
*/
public Optional getClassName() {
return getOptionValue("className");
}
/**
* Intent string parameters.
*
* @param es Map, where the key is arg parameter name and value is its string value.
* @return self instance for chaining.
*/
public IntentOptions withEs(Map es) {
return assignOptionValue("es", es);
}
/**
* Get intent string parameters.
*
* @return Intent string parameters mapping.
*/
public Optional